Exception: URL fetch failure on https://storage.googleapis.com/keras/efficientnetb0_notop.h5

14 views Asked by At

def make_model(img_size, lr):
img_shape = (img_size[0], img_size[1], 3)

base_model = tf.keras.applications.efficientnet.EfficientNetB0(include_top=False, weights="imagenet", input_shape=img_shape, pooling='max')
msg = 'Created EfficientNet B0 model'

base_model.trainable = True
x = base_model.output
x = BatchNormalization(axis=-1, momentum=0.99, epsilon=0.001)(x)
x = Dense(256, kernel_regularizer=regularizers.l2(l=0.016), activity_regularizer=regularizers.l1(0.006),
                bias_regularizer=regularizers.l1(0.006), activation='relu')(x)
x = Dropout(rate=0.4, seed=123)(x)       
output = Dense(class_count, activation='softmax')(x)
model = Model(inputs=base_model.input, outputs=output)

# Evidential Begins
model.compile(Adamax(learning_rate=lr), loss='categorical_crossentropy', metrics=['accuracy', F1_score, 'AUC']) 
msg = msg + f' with initial learning rate set to {lr}'
print_in_color(msg)
return model

lr = 0.001 model = make_model(img_size, lr)

While running this code, i am getting following issue Downloading data from https://storage.googleapis.com/keras-applications/efficientnetb0_notop.h5

gaierror Traceback (most recent call last) File /opt/conda/lib/python3.10/urllib/request.py:1348, in AbstractHTTPHandler.do_open(self, http_class, req, **http_conn_args) 1347 try: -> 1348 h.request(req.get_method(), req.selector, req.data, headers, 1349 encode_chunked=req.has_header('Transfer-encoding')) 1350 except OSError as err: # timeout error

File /opt/conda/lib/python3.10/http/client.py:1283, in HTTPConnection.request(self, method, url, body, headers, encode_chunked) 1282 """Send a complete request to the server.""" -> 1283 self._send_request(method, url, body, headers, encode_chunked)

File /opt/conda/lib/python3.10/http/client.py:1329, in HTTPConnection._send_request(self, method, url, body, headers, encode_chunked) 1328 body = _encode(body, 'body') -> 1329 self.endheaders(body, encode_chunked=encode_chunked)

File /opt/conda/lib/python3.10/http/client.py:1278, in HTTPConnection.endheaders(self, message_body, encode_chunked) 1277 raise CannotSendHeader() -> 1278 self._send_output(message_body, encode_chunked=encode_chunked)

Exception: URL fetch failure on https://storage.googleapis.com/keras-applications/efficientnetb0_notop.h5: None -- [Errno -3] Temporary failure in name resolution

I am trying to fetch the model from keras application

0

There are 0 answers