HELP Error when loading base_model in ungraded chunk 10 of W2A2

I don’t have any specific guidance on the best time of day to run this assignment.

This is definitely a Coursera problem.

Running tensorflow-gpu on local setup works fine.

base_model = tf.keras.applications.MobileNetV2(input_shape=(160, 160, 3), weights=‘imagenet’, include_top=True)
Downloading data from https://storage.googleapis.com/tensorflow/keras-applications/mobilenet_v2/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_160.h5
14540800/14536120 [==============================] - 6s 0us/step
14548992/14536120 [==============================] - 6s 0us/step
base_model.summary()
Model: “mobilenetv2_1.00_160”


Layer (type) Output Shape Param # Connected to

input_1 (InputLayer) [(None, 160, 160, 3) 0


Conv1 (Conv2D) (None, 80, 80, 32) 864 input_1[0][0]


bn_Conv1 (BatchNormalization) (None, 80, 80, 32) 128 Conv1[0][0]


Conv1_relu (ReLU) (None, 80, 80, 32) 0 bn_Conv1[0][0]


expanded_conv_depthwise (Depthw (None, 80, 80, 32) 288 Conv1_relu[0][0]


expanded_conv_depthwise_BN (Bat (None, 80, 80, 32) 128 expanded_conv_depthwise[0][0]


expanded_conv_depthwise_relu (R (None, 80, 80, 32) 0 expanded_conv_depthwise_BN[0][0]


expanded_conv_project (Conv2D) (None, 80, 80, 16) 512 expanded_conv_depthwise_relu[0][0


expanded_conv_project_BN (Batch (None, 80, 80, 16) 64 expanded_conv_project[0][0]


block_1_expand (Conv2D) (None, 80, 80, 96) 1536 expanded_conv_project_BN[0][0]


block_1_expand_BN (BatchNormali (None, 80, 80, 96) 384 block_1_expand[0][0]


block_1_expand_relu (ReLU) (None, 80, 80, 96) 0 block_1_expand_BN[0][0]


block_1_pad (ZeroPadding2D) (None, 81, 81, 96) 0 block_1_expand_relu[0][0]


block_1_depthwise (DepthwiseCon (None, 40, 40, 96) 864 block_1_pad[0][0]



global_average_pooling2d (Globa (None, 1280) 0 out_relu[0][0]


predictions (Dense) (None, 1000) 1281000 global_average_pooling2d[0][0]

Total params: 3,538,984
Trainable params: 3,504,872
Non-trainable params: 34,112

Facing same error

Exception: URL fetch failure on https://storage.googleapis.com/tensorflow/keras-applications/mobilenet_v2/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_160.h5: None – [Errno 99] Cannot assign requested address

It’s been reported to the course staff.

Hey I am facing the same error. Kindly let me know if there are any updates regarding this.

Facing same error

Hi,
same error here. I hope it is somehow solved soon.
Thank you.

Just to share with the rest of students: I tried repeatedly to execute the load instruction and after around 30-40 trials it loaded eventually.

The issue is being investigated.

No additional reports are necessary.

Please monitor this thread for updates.

This will be the main thread for reporting the status of this issue.

Follow this thread for updates.

Can they predownload the base model and the weights to the jupyter environment or make them available in the lab files as a work around for this problem? @TMosh

Course staff is working on a solution.

2 Likes

Sorry, but do you have any updates on this?

Please see my reply on this thread from 13 hours ago.

This is just for information for someone searching workaround.
I downloaded required files(h5, json…) and uploaded to notebook.
And load those files, It works.
But it cannot be compile when submit.
So, just wait for fixing or study with uploaded and change to original code and submit.

I have the same issue.
Here is the lines from the console

Downloading data from https://storage.googleapis.com/tensorflow/keras-applications/mobilenet_v2/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_160.h5

OSError Traceback (most recent call last)
/opt/conda/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1318 h.request(req.get_method(), req.selector, req.data, headers,
→ 1319 encode_chunked=req.has_header(‘Transfer-encoding’))
1320 except OSError as err: # timeout error

/opt/conda/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked)
1251 “”“Send a complete request to the server.”“”
→ 1252 self._send_request(method, url, body, headers, encode_chunked)
1253

/opt/conda/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1297 body = _encode(body, ‘body’)
→ 1298 self.endheaders(body, encode_chunked=encode_chunked)
1299

/opt/conda/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked)
1246 raise CannotSendHeader()
→ 1247 self._send_output(message_body, encode_chunked=encode_chunked)
1248

/opt/conda/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked)
1025 del self._buffer[:]
→ 1026 self.send(msg)
1027

/opt/conda/lib/python3.7/http/client.py in send(self, data)
965 if self.auto_open:
→ 966 self.connect()
967 else:

/opt/conda/lib/python3.7/http/client.py in connect(self)
1413
→ 1414 super().connect()
1415

/opt/conda/lib/python3.7/http/client.py in connect(self)
937 self.sock = self._create_connection(
→ 938 (self.host,self.port), self.timeout, self.source_address)
939 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

/opt/conda/lib/python3.7/socket.py in create_connection(address, timeout, source_address)
727 try:
→ 728 raise err
729 finally:

/opt/conda/lib/python3.7/socket.py in create_connection(address, timeout, source_address)
715 sock.bind(source_address)
→ 716 sock.connect(sa)
717 # Break explicitly a reference cycle

OSError: [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

URLError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
277 try:
→ 278 urlretrieve(origin, fpath, dl_progress)
279 except HTTPError as e:

/opt/conda/lib/python3.7/urllib/request.py in urlretrieve(url, filename, reporthook, data)
246
→ 247 with contextlib.closing(urlopen(url, data)) as fp:
248 headers = fp.info()

/opt/conda/lib/python3.7/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
221 opener = _opener
→ 222 return opener.open(url, data, timeout)
223

/opt/conda/lib/python3.7/urllib/request.py in open(self, fullurl, data, timeout)
524
→ 525 response = self._open(req, data)
526

/opt/conda/lib/python3.7/urllib/request.py in _open(self, req, data)
542 result = self._call_chain(self.handle_open, protocol, protocol +
→ 543 ‘_open’, req)
544 if result:

/opt/conda/lib/python3.7/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
502 func = getattr(handler, meth_name)
→ 503 result = func(*args)
504 if result is not None:

/opt/conda/lib/python3.7/urllib/request.py in https_open(self, req)
1361 return self.do_open(http.client.HTTPSConnection, req,
→ 1362 context=self._context, check_hostname=self._check_hostname)
1363

/opt/conda/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1320 except OSError as err: # timeout error
→ 1321 raise URLError(err)
1322 r = h.getresponse()

URLError: <urlopen error [Errno 99] Cannot assign requested address>

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
in
2 base_model = tf.keras.applications.MobileNetV2(input_shape=IMG_SHAPE,
3 include_top=True,
----> 4 weights=‘imagenet’)

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/applications/mobilenet_v2.py in MobileNetV2(input_shape, alpha, include_top, weights, input_tensor, pooling, classes, classifier_activation, **kwargs)
401 weight_path = BASE_WEIGHT_PATH + model_name
402 weights_path = data_utils.get_file(
→ 403 model_name, weight_path, cache_subdir=‘models’)
404 else:
405 model_name = (‘mobilenet_v2_weights_tf_dim_ordering_tf_kernels_’ +

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
280 raise Exception(error_msg.format(origin, e.code, e.msg))
281 except URLError as e:
→ 282 raise Exception(error_msg.format(origin, e.errno, e.reason))
283 except (Exception, KeyboardInterrupt) as e:
284 if os.path.exists(fpath):

Exception: URL fetch failure on https://storage.googleapis.com/tensorflow/keras-applications/mobilenet_v2/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_160.h5: None – [Errno 99] Cannot assign requested address

==

Hi. Still the same issue. Do you have any estimate when it would be fixed @TMosh? Thanks

A new version of the notebook has been published. Also there was an update to the grader - so you must use the new notebook.

You will need to move your code from the auto-saved file into the new notebook.

5 Likes

Thanks @TMosh,

I can confirm that I’ve tested and it works correctly now.