fchollet / deep-learning-models

Keras code and weights files for popular deep learning models.
MIT License
7.32k stars 2.46k forks source link

can't download inceptionV3 weights in keras #101

Open HarshVardhanSh opened 6 years ago

HarshVardhanSh commented 6 years ago

Hi, I am trying to download weights of inceptionV3 in keras using the command base_model = InceptionV3(weights = 'imagenet', include_top = False) . It ended up with Exception Error : Name or Service not known and the download fails. I dont understand whats the problem?

Graystripe17 commented 6 years ago

Same for v2

Exception: URL fetch failure on https://github.com/fchollet/deep-learning-models/releases/download/v0.7/inception_resnet_v2_weights_tf_dim_ordering_tf_kernels_notop.h5: None -- [Errno -2] Name or service not known

ZhengQidong1 commented 6 years ago

I have a question,Exception: URL fetch failure on https://github.com/fchollet/deep-learning-models/releases/download/v0.5/inception_v3_weights_tf_dim_ordering_tf_kernels.h5: None -- [Errno 110] Connection timed out swig/python detected a memory leak of type 'int64_t *', no destructor found. who could help me? thank you very much

wgy1027 commented 3 years ago

Me too.

import tensorflow as tf from tensorflow.keras.applications.inception_v3 import InceptionV3 model = InceptionV3(weights='imagenet')

The error information from the system is as follows:

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

/opt/conda/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked) 1276 """Send a complete request to the server.""" -> 1277 self._send_request(method, url, body, headers, encode_chunked) 1278

/opt/conda/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked) 1322 body = _encode(body, 'body') -> 1323 self.endheaders(body, encode_chunked=encode_chunked) 1324

/opt/conda/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked) 1271 raise CannotSendHeader() -> 1272 self._send_output(message_body, encode_chunked=encode_chunked) 1273

/opt/conda/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked) 1031 del self._buffer[:] -> 1032 self.send(msg) 1033

/opt/conda/lib/python3.7/http/client.py in send(self, data) 971 if self.auto_open: --> 972 self.connect() 973 else:

/opt/conda/lib/python3.7/http/client.py in connect(self) 1438 -> 1439 super().connect() 1440

/opt/conda/lib/python3.7/http/client.py in connect(self) 943 self.sock = self._create_connection( --> 944 (self.host,self.port), self.timeout, self.source_address) 945 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

/opt/conda/lib/python3.7/socket.py in create_connection(address, timeout, source_address) 706 err = None --> 707 for res in getaddrinfo(host, port, 0, SOCK_STREAM): 708 af, socktype, proto, canonname, sa = res

/opt/conda/lib/python3.7/socket.py in getaddrinfo(host, port, family, type, proto, flags) 751 addrlist = [] --> 752 for res in _socket.getaddrinfo(host, port, family, type, proto, flags): 753 af, socktype, proto, canonname, sa = res

gaierror: [Errno -3] Temporary failure in name resolution

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) 274 try: --> 275 urlretrieve(origin, fpath, dl_progress) 276 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) 1392 return self.do_open(http.client.HTTPSConnection, req, -> 1393 context=self._context, check_hostname=self._check_hostname) 1394

/opt/conda/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1351 except OSError as err: # timeout error -> 1352 raise URLError(err) 1353 r = h.getresponse()

URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)

in ----> 1 model = InceptionV3(weights='imagenet') 2 3 model.summary() /opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/applications/inception_v3.py in InceptionV3(include_top, weights, input_tensor, input_shape, pooling, classes, classifier_activation) 347 WEIGHTS_PATH, 348 cache_subdir='models', --> 349 file_hash='9a0d58056eeedaa3f26cb7ebd46da564') 350 else: 351 weights_path = data_utils.get_file( /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 raise Exception(error_msg.format(origin, e.code, e.msg)) 278 except URLError as e: --> 279 raise Exception(error_msg.format(origin, e.errno, e.reason)) 280 except (Exception, KeyboardInterrupt) as e: 281 if os.path.exists(fpath): Exception: URL fetch failure on https://storage.googleapis.com/tensorflow/keras-applications/inception_v3/inception_v3_weights_tf_dim_ordering_tf_kernels.h5: None -- [Errno -3] Temporary failure in name resolution `
CItyM commented 3 years ago

Check if the Internet setting of the notebook is ON.

OlegXio commented 1 year ago

Download a VPN client for the whole PC network, such as WireGuard (but it and similar applications require a tunnel file.) I downloaded it successfully, but the problem was the error "We're sorry, but this service is not available in your location".