Skip to content
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

OSError: SavedModel file does not exist at: C:\Users\user\.urduhack\models\tokenizer\word\word_tokenizer.h5\{saved_model.pbtxt|saved_model.pb} #143

Open
ahsanfarooqui opened this issue May 28, 2021 · 0 comments

Comments

@ahsanfarooqui
Copy link

How to reproduce the behavior

import urduhack
urduhack.download()
from urduhack.tokenization import word_tokenizer
a = "احسن فاروقی"
word_tokenizer(a)

Your Environment

  • Operating System: Windows 10
  • Python Version Used: 3.8.3
  • Urduhack Version Used: 1.1.1
  • Environment Information: Jupyter notebook
  • Tensorflow version: 2.5.0
  • Keras Version: 2.5.0

Error Generated:


OSError Traceback (most recent call last)
in
1 a = "احسن فاروقی"
----> 2 word_tokenizer(a)

~\AppData\Roaming\Python\Python38\site-packages\urduhack\tokenization\tokenizer.py in word_tokenizer(sentence, max_len)
62 if _WORD_TOKENIZER_MODEL is None:
63 _is_model_exist(WORD_TOKENIZER_MODEL_PATH, WORD_TOKENIZER_VOCAB_PATH)
---> 64 _WORD_TOKENIZER_MODEL, _CHAR2IDX, _IDX2CHAR = load_model(WORD_TOKENIZER_MODEL_PATH, WORD_TOKENIZER_VOCAB_PATH)
65
66 inp
, _ = _preprocess_sentence(sentence, _CHAR2IDX, max_len=max_len)

~\AppData\Roaming\Python\Python38\site-packages\urduhack\tokenization\keras_tokenizer.py in load_model(model_path, vocab_path)
96 """
97
---> 98 model
= tf.keras.models.load_model(model_path)
99
100 char2idx_, idx2char_ = _load_vocab(vocab_path)

~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\saving\save.py in load_model(filepath, custom_objects, compile, options)
204 filepath = path_to_string(filepath)
205 if isinstance(filepath, str):
--> 206 return saved_model_load.load(filepath, compile, options)
207
208 raise IOError(

~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\saving\saved_model\load.py in load(path, compile, options)
119 # Look for metadata file or parse the SavedModel
120 metadata = saved_metadata_pb2.SavedMetadata()
--> 121 meta_graph_def = loader_impl.parse_saved_model(path).meta_graphs[0]
122 object_graph_def = meta_graph_def.object_graph_def
123 path_to_metadata_pb = os.path.join(path, constants.SAVED_METADATA_PATH)

~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\saved_model\loader_impl.py in parse_saved_model(export_dir)
111 raise IOError("Cannot parse file %s: %s." % (path_to_pbtxt, str(e)))
112 else:
--> 113 raise IOError(
114 "SavedModel file does not exist at: %s%s{%s|%s}" %
115 (export_dir, os.path.sep, constants.SAVED_MODEL_FILENAME_PBTXT,

OSError: SavedModel file does not exist at: C:\Users\user/.urduhack/models/tokenizer/word/word_tokenizer.h5{saved_model.pbtxt|saved_model.pb}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant