GithubHelp home page GithubHelp logo

Failed to download model about hub HOT 21 CLOSED

mohamedaashraf avatar mohamedaashraf commented on August 18, 2024
Failed to download model

from hub.

Comments (21)

akhorlin avatar akhorlin commented on August 18, 2024 2

from hub.

andresusanopinto avatar andresusanopinto commented on August 18, 2024 2

If you believe your issue is not due to ".dev", please create a new issue with an error output of running:

$ wget 'https://tfhub.dev/google/nnlm-en-dim128/1?tf-hub-format=compressed' -O /tmp/module.tar.gz

Avoid fallback to links such as "https://storage.googleapis.com/...", as those may break at anytime with no warning. The only stable url for modules hosted in tfhub.dev are the "https://tfhub.dev/" ones.

from hub.

jinx2018 avatar jinx2018 commented on August 18, 2024 2

You can try to access by using the mirror image backup in China, Specifically, suppose you are having trouble in accessing

model = hub.load('https://tfhub.dev/google/yamnet/1')

You switch to the mirror image in China, with following:

model = hub.load('https://hub.tensorflow.google.cn/google/yamnet/1')

from hub.

hansanjie avatar hansanjie commented on August 18, 2024 1

it does not work anymore. I can not download Tf_mode from any of two directories .otherwith, I want download Inception V3 mode, does anyone know the new directory?

from hub.

andresusanopinto avatar andresusanopinto commented on August 18, 2024 1

Please see discussion in #97.

It appears many have installed software that takes control over ".dev" domain. TensorFlow Hub library then fails to reach the proper server (either with an SSL issue or other obscure error).

Users are highly recomended to switch off their ".dev" hijacking into ".test" [reserved for that purposed], since the ".dev" is nowadays a gTLD.

from hub.

TanLingxiao avatar TanLingxiao commented on August 18, 2024 1

You can download your the model need from url + '?tf-hub-format=compressed', such as 'https://tfhub.dev/google/imagenet/pnasnet_large/classification/2?tf-hub-format=compressed' . This file will be named 'x.tar.gz', then make two file in β€˜/tmp/tfhub_modules’ named such as '67f40766542914aa2dd2ec6923c4f353f6d0663c' and '67f40766542914aa2dd2ec6923c4f353f6d0663c.descriptor.txt' ,decompression 1.tar.gz to 67f40766542914aa2dd2ec6923c4f353f6d0663c.

from hub.

akhorlin avatar akhorlin commented on August 18, 2024

Let us know a bit more info about the environment you are running (py, os versions, are you running on corp network that may have restricted access to some external sites), and the code in question.

from hub.

mohamedaashraf avatar mohamedaashraf commented on August 18, 2024

I'm running on ubuntu, Python codes
And this is my home network, so there is no restricted access there

from hub.

mohamedaashraf avatar mohamedaashraf commented on August 18, 2024

And I'm using the same retrain.py code from this repo

from hub.

mohamedaashraf avatar mohamedaashraf commented on August 18, 2024

It's downloading tar file with size more than 400 MB

from hub.

mohamedaashraf avatar mohamedaashraf commented on August 18, 2024

I will close this issue, since I have found the solution..
I exchanged the download link
https://tfhub.dev/google/imagenet/inception_resnet_v2/classification/1
with
https://storage.googleapis.com/tensorflow-hub/google/imagenet/inception_resnet_v2/classification/1.tar.gz
and now, the download works!

from hub.

andreyc0d3r avatar andreyc0d3r commented on August 18, 2024

im having the same issue

`INFO:tensorflow:Downloading TF-Hub Module 'https://tfhub.dev/google/imagenet/inception_v3/feature_vector/1'.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "retrain.py", line 1333, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "retrain.py", line 1017, in main
module_spec = hub.load_module_spec(FLAGS.tfhub_module)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_hub/native_module.py", line 99, in load_module_spec
path = compressed_module_resolver.get_default().get_module_path(path)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_hub/resolver.py", line 385, in get_module_path
return self._get_module_path(handle)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_hub/resolver.py", line 467, in _get_module_path
return resolver.get_module_path(handle)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_hub/resolver.py", line 385, in get_module_path
return self._get_module_path(handle)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_hub/compressed_module_resolver.py", line 105, in _get_module_path
self._lock_file_timeout_sec())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_hub/resolver.py", line 313, in atomic_download
download_fn(handle, tmp_dir)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_hub/compressed_module_resolver.py", line 101, in download
response = url_opener.open(request)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)>`

from hub.

JIAZHEN avatar JIAZHEN commented on August 18, 2024

I have the same issue even after I ran Install Certificates.command. Can you please reopen this issue and have a look?

from hub.

sivakotich avatar sivakotich commented on August 18, 2024

Same issue is observed with python 2.7 also(error mentioned by andreyc0d3r. Any working solutions?

wget 'https://tfhub.dev/google/nnlm-en-dim128/1?tf-hub-format=compressed' -O /tmp/module.tar.gz works fine without any issue

from hub.

xieximing avatar xieximing commented on August 18, 2024

I seem have the similar issue for downloading the module. After I imported the import tensorflow_hub as hub then I tried to download a fast-RCNN Module through detector=hub.Module("https://tfhub.dev/google/faster_rcnn/openimages_v4/inception_resnet_v2/1" ) but I got this feedback:

Traceback (most recent call last):
File "", line 1, in
File "/data/xieximing/venv/lib/python2.7/site-packages/tensorflow_hub/module.py", line 105, in init
self._spec = as_module_spec(spec)
File "/data/xieximing/venv/lib/python2.7/site-packages/tensorflow_hub/module.py", line 31, in as_module_spec
return native_module.load_module_spec(spec)
File "/data/xieximing/venv/lib/python2.7/site-packages/tensorflow_hub/native_module.py", line 99, in load_module_spec
path = compressed_module_resolver.get_default().get_module_path(path)
File "/data/xieximing/venv/lib/python2.7/site-packages/tensorflow_hub/compressed_module_resolver.py", line 141, in get_default
HttpCompressedFileResolver(),
File "/data/xieximing/venv/lib/python2.7/site-packages/tensorflow_hub/compressed_module_resolver.py", line 74, in init
self._cache_dir = resolver.tfhub_cache_dir(cache_dir, use_temp=True)
File "/data/xieximing/venv/lib/python2.7/site-packages/tensorflow_hub/resolver.py", line 67, in tfhub_cache_dir
os.getenv(_TFHUB_CACHE_DIR, "") or FLAGS["tfhub_cache_dir"].value or
TypeError: '_FlagValues' object has no attribute 'getitem'

from hub.

arnoegw avatar arnoegw commented on August 18, 2024

xieximing, you also filed that as #169. I will respond there.

from hub.

perveil avatar perveil commented on August 18, 2024

embed = hub.Module("https://storage.googleapis.com/tfhub-modules/google/Wiki-words-500-with-normalization")

i had read above comments and make some improvements, but my request don`t have any reponse

from hub.

arnoegw avatar arnoegw commented on August 18, 2024

The module handles for use with hub.Module, hub.resolve, etc. can either be a filesystem path or the URL of a web service following tensorflow.org/hub/hosting#protocol. Please try https://tfhub.dev/google/Wiki-words-500-with-normalization/1 instead.

from hub.

wAuner avatar wAuner commented on August 18, 2024

Please see discussion in #97.

It appears many have installed software that takes control over ".dev" domain. TensorFlow Hub library then fails to reach the proper server (either with an SSL issue or other obscure error).

Users are highly recomended to switch off their ".dev" hijacking into ".test" [reserved for that purposed], since the ".dev" is nowadays a gTLD.

@andresusanopinto
Thanks for your reply. I'm also facing this issue. Could you elaborate on this hijacking issue? How could I find out what's responsible for this?

from hub.

robindierckx avatar robindierckx commented on August 18, 2024

got the same error, although it worked with a wget command and with a minimal python script importing only tensorflow and the hub. It turned out to be dependency related. I fixed it by changing initial dependency order:

  # not working
  import csv, os, sys, time, mysql.connector 
  import tensorflow_hub as hub 

into:

  # working
  import tensorflow_hub as hub # must be imported first to avoid tensorflow error: https://github.com/tensorflow/hub/issues/53
  import csv, os, sys, time, mysql.connector 

from hub.

muhammadatifaltaf avatar muhammadatifaltaf commented on August 18, 2024

Solved by using this:
module_handle = "https://tfhub.dev/tensorflow/faster_rcnn/resnet101_v1_640x640/1"

model = hub.load(module_handle)

from hub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.