why getting an error while loading a model?

48 views Asked by At

I am trying to use the MobileNet but I get this error although I used the same code yesterday and it was working " None -- [Errno -3] Temporary failure in name resolution".

    baseModel = MobileNetV2(weights="imagenet", include_top=False,input_tensor=Input(shape=(224, 224, 3)))
    headModel = baseModel.output
    headModel = AveragePooling2D(pool_size=(7, 7))(headModel)
    headModel = Flatten(name="flatten")(headModel)
    headModel = Dense(128, activation="relu")(headModel)
    headModel = Dropout(0.5)(headModel)
    headModel = Dense(2, activation="softmax")(headModel)

    model = Model(inputs=baseModel.input, outputs=headModel)
    model.summary()
    
    for layer in baseModel.layers:
        layer.trainable = False
0

There are 0 answers