-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: ValueError when loading model previously cached but now missing #896
Comments
To avoid the issue of TF-Hub looking in temp directory for cached models, you can customise the download location to home directory by by setting the environment variable I would recommend you to download the model from
Other way would be to instruct the tensorflow_hub library to directly read models from remote storage (GCS) instead of downloading the models locally. This way, no caching directory is needed. Ref: Caching model downloads from TF Hub. Thank you! |
Thanks for the workaround. In my case, I am developing a package where the tensorflow hub usage is "under the hood" and not part of the user's experience. I feel it should be possible to avoid this buggy default download behavior without requiring the user to make changes to their TF Hub environment variables. |
@sammlapp, Thank you for the feedback. Let us discuss this feature implementation internally and we will update this thread. Thanks! |
Are there any plans to address this issue? Thanks |
Closing this due to inactivity. Please take a look into the answers provided above, feel free to reopen and post your comments(if you still have queries on this). Thank you! |
What happened?
Loading a tensorflow hub model that I previously loaded results in an error. As described in #575, it seems that TF Hub looks for the model in an existing temp directory. The model is gone, but the folder still exists. If I manually delete the folder, and re-run
tensorflow_hub.load(url)
it works properly. Therefore, it seems there is a bug in the way that TF Hub looks for cached models.The correct behavior would be to re-download the model if does not exist locally, or to use the cached version if it exists locally.
It seems as if this PR should have resolved the issue
#602
A related issue: https://stackoverflow.com/questions/63078695/savedmodel-file-does-not-exist-when-using-tensorflow-hub
Relevant code
Relevant log output
tensorflow_hub Version
other (please specify)
TensorFlow Version
other (please specify)
Other libraries
Tensorflow: '2.13.0'
Tensorflow Hub: '0.14.0'
Python Version
3.x
OS
macOS
The text was updated successfully, but these errors were encountered: