-
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
Saved Model doesn't exist error, when trying to use TensorFlow Hub #816
Comments
Also, the problem doesn't seem to be from TensorFlow-Hub, since when I run
Everything runs smoothly, and I get the desired output. |
@IavTavares Could you please refer to the similar issues link1, link2 ,Please have a look at the common issues and let us know if it helps?Thank you! |
I tried one of the answers in link1. I downloaded the preprocessing model, and redirected the hub.load() statement to the model's directory. I also had to do something similar for the encoder. |
@IavTavares Thank you for the update! Could you please let us know if this issue is resolved ? Thanks! |
Well... it depends on what you mean by resolved. If you mean did I find a workaround? Yes. If the underlying issue was solved? No.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: ***@***.***>
Sent: 22 October 2021 04:49
To: ***@***.***>
Cc: ***@***.***>; ***@***.***>
Subject: Re: [tensorflow/tensorflow] Saved Model doesn't exist error, when trying to use TensorFlow Hub (Issue tensorflow/tensorflow#52606)
@IavTavares<https://github.com/IavTavares> Thank you for the update! Could you please let us know if this issue is resolved ? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://github.com/tensorflow/tensorflow/issues/52606#issuecomment-949262894>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AV4NS6PS7RCEXJ6FSSVQHATUIDNLJANCNFSM5GNNZ5ZQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Are you getting this error only when loading the model |
If I run
tfhub_handle_preprocess="https://tfhub.dev/tensorflow/bert_en_uncased_preprocess/3"
bert_preprocess_model = hub.KerasLayer(tfhub_handle_preprocess)
tfhub_handle_encoder="https://tfhub.dev/tensorflow/small_bert/bert_en_uncased_L-12_H-128_A-2/2"
bert_model = hub.KerasLayer(tfhub_handle_encoder)
Then I get the same error. However, if I point tfhub_handle_preprocess to a directory with the preprocess already downloaded, then everything works fine.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: ***@***.***>
Sent: 22 October 2021 16:22
To: ***@***.***>
Cc: ***@***.***>; ***@***.***>
Subject: Re: [tensorflow/hub] Saved Model doesn't exist error, when trying to use TensorFlow Hub (Issue #816)
@IavTavares<https://github.com/IavTavares>,
Are you getting this error only when loading the model small_bert/bert_en_uncased_L-4_H-512_A-8? Can you try using ert_model_name = small_bert/bert_en_uncased_L-2_H-128_A-2 and let us know if you're getting the same error for that one as well? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#816 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AV4NS6JYBDWEQKGNQ5EEAT3UIF6R5ANCNFSM5GQVNJ2A>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Can you try providing a custom directory for |
Closing this issue due to inactivity.Please feel free to reopen if this issue still persists.Thanks |
System information
-Windows 10
Describe the problem
I'm trying to follow tensorflow's tutorial on how to classify text with the BERT model.
However, using their notebook, I encounter a error message telling me that the model I saved does not exist.
Provide the exact sequence of commands / steps that you executed before running into the problem
I run the notebook I downloaded above. Everything goes well, until I run the following:
bert_preprocess_model = hub.KerasLayer(tfhub_handle_preprocess)
Any other info / logs
OSError Traceback (most recent call last)
in
----> 1 bert_preprocess_model = hub.KerasLayer(tfhub_handle_preprocess)
~\anaconda3\lib\site-packages\tensorflow_hub\keras_layer.py in init(self, handle, trainable, arguments, _sentinel, tags, signature, signature_outputs_as_dict, output_key, output_shape, load_options, **kwargs)
151
152 self._load_options = load_options
--> 153 self._func = load_module(handle, tags, self._load_options)
154 self._has_training_argument = func_has_training_argument(self._func)
155 self._is_hub_module_v1 = getattr(self._func, "_is_hub_module_v1", False)
~\anaconda3\lib\site-packages\tensorflow_hub\keras_layer.py in load_module(handle, tags, load_options)
447 except ImportError: # Expected before TF2.4.
448 set_load_options = load_options
--> 449 return module_v2.load(handle, tags=tags, options=set_load_options)
450
451
~\anaconda3\lib\site-packages\tensorflow_hub\module_v2.py in load(handle, tags, options)
104 module_path, tags=tags, options=options)
105 else:
--> 106 obj = tf.compat.v1.saved_model.load_v2(module_path, tags=tags)
107 obj._is_hub_module_v1 = is_hub_module_v1 # pylint: disable=protected-access
108 return obj
~\anaconda3\lib\site-packages\tensorflow\python\saved_model\load.py in load(export_dir, tags, options)
862 """
863 metrics.IncrementReadApi(_LOAD_V2_LABEL)
--> 864 result = load_internal(export_dir, tags, options)["root"]
865 metrics.IncrementRead()
866 return result
~\anaconda3\lib\site-packages\tensorflow\python\saved_model\load.py in load_internal(export_dir, tags, options, loader_cls, filters)
876 tags = nest.flatten(tags)
877 saved_model_proto, debug_info = (
--> 878 loader_impl.parse_saved_model_with_debug_info(export_dir))
879
880 if (len(saved_model_proto.meta_graphs) == 1 and
~\anaconda3\lib\site-packages\tensorflow\python\saved_model\loader_impl.py in parse_saved_model_with_debug_info(export_dir)
58 parsed. Missing graph debug info file is fine.
59 """
---> 60 saved_model = _parse_saved_model(export_dir)
61
62 debug_info_path = os.path.join(
~\anaconda3\lib\site-packages\tensorflow\python\saved_model\loader_impl.py in parse_saved_model(export_dir)
116 raise IOError("Cannot parse file %s: %s." % (path_to_pbtxt, str(e)))
117 else:
--> 118 raise IOError(
119 "SavedModel file does not exist at: %s%s{%s|%s}" %
120 (export_dir, os.path.sep, constants.SAVED_MODEL_FILENAME_PBTXT,
OSError: SavedModel file does not exist at: C:\Users\iavta\AppData\Local\Temp\tfhub_modules\602d30248ff7929470db09f7385fc895e9ceb4c0{saved_model.pbtxt|saved_model.pb}
In the directory C:\Users\iavta\AppData\Local\Temp\tfhub_modules\602d30248ff7929470db09f7385fc895e9ceb4c0
I have only two empty folders called "assets" and "variables".
The text was updated successfully, but these errors were encountered: