# SavedModel file does not exist at:

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsavedmodel-file-does-not-exist-at%2F85959%3E%5C
**Category:** Models\
**Created:** [May 9, 2024, 11:38am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsavedmodel-file-does-not-exist-at%2F85959 "2024-05-09T11:38:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soufyane](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/soufyane/32/26793_2.png) [@soufyane](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsoufyane)%5C
**Post date:** [May 9, 2024, 11:38am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsavedmodel-file-does-not-exist-at%2F85959%2F1 "2024-05-09T11:38:09Z")

</div>

how to fix this error

## from huggingface\_hub import from\_pretrained\_keras ​ model = from\_pretrained\_keras(“soufyane/gemma\_data\_science”) ​

OSError Traceback (most recent call last)  
Cell In[8], line 3  
1 from huggingface\_hub import from\_pretrained\_keras  
----\> 3 model = from\_pretrained\_keras(“soufyane/gemma\_data\_science”)

File /opt/conda/lib/python3.10/site-packages/huggingface\_hub/keras\_mixin.py:296, in from\_pretrained\_keras(\*args, \*\*kwargs)  
240 def from\_pretrained\_keras(\*args, \*\*kwargs) → “KerasModelHubMixin”:  
241 r"“”  
242 Instantiate a pretrained Keras model from a pre-trained model from the Hub.  
243 The model is expected to be in `SavedModel` format.  
(…)  
294   
295 “”"  
 → 296 return KerasModelHubMixin.from\_pretrained(\*args, \*\*kwargs)

File /opt/conda/lib/python3.10/site-packages/huggingface\_hub/utils/\_validators.py:119, in validate\_hf\_hub\_args..\_inner\_fn(\*args, \*\*kwargs)  
116 if check\_use\_auth\_token:  
117 kwargs = smoothly\_deprecate\_use\_auth\_token(fn\_name=fn. **name** , has\_token=has\_token, kwargs=kwargs)  
 → 119 return fn(\*args, \*\*kwargs)

File /opt/conda/lib/python3.10/site-packages/huggingface\_hub/hub\_mixin.py:420, in ModelHubMixin.from\_pretrained(cls, pretrained\_model\_name\_or\_path, force\_download, resume\_download, proxies, token, cache\_dir, local\_files\_only, revision, \*\*model\_kwargs)  
417 if cls.\_hub\_mixin\_inject\_config:  
418 model\_kwargs[“config”] = config  
 → 420 instance = cls.\_from\_pretrained(  
421 model\_id=str(model\_id),  
422 revision=revision,  
423 cache\_dir=cache\_dir,  
424 force\_download=force\_download,  
425 proxies=proxies,  
426 resume\_download=resume\_download,  
427 local\_files\_only=local\_files\_only,  
428 token=token,  
429 \*\*model\_kwargs,  
430 )  
432 # Implicitly set the config as instance attribute if not already set by the class  
433 # This way `config` will be available when calling `save_pretrained` or `push_to_hub`.  
434 if config is not None and (getattr(instance, “\_hub\_mixin\_config”, None) in (None, {})):

File /opt/conda/lib/python3.10/site-packages/huggingface\_hub/keras\_mixin.py:497, in KerasModelHubMixin.\_from\_pretrained(cls, model\_id, revision, cache\_dir, force\_download, proxies, resume\_download, local\_files\_only, token, config, \*\*model\_kwargs)  
494 storage\_folder = model\_id  
496 # TODO: change this in a future PR. We are not returning a KerasModelHubMixin instance here…  
 → 497 model = keras.models.load\_model(storage\_folder)  
499 # For now, we add a new attribute, config, to store the config loaded from the hub/a local dir.  
500 model.config = config

File /opt/conda/lib/python3.10/site-packages/tf\_keras/src/saving/saving\_api.py:262, in load\_model(filepath, custom\_objects, compile, safe\_mode, \*\*kwargs)  
254 return saving\_lib.load\_model(  
255 filepath,  
256 custom\_objects=custom\_objects,  
257 compile=compile,  
258 safe\_mode=safe\_mode,  
259 )  
261 # Legacy case.  
 → 262 return legacy\_sm\_saving\_lib.load\_model(  
263 filepath, custom\_objects=custom\_objects, compile=compile, \*\*kwargs  
264 )

File /opt/conda/lib/python3.10/site-packages/tf\_keras/src/utils/traceback\_utils.py:70, in filter\_traceback..error\_handler(\*args, \*\*kwargs)  
67 filtered\_tb = \_process\_traceback\_frames(e. **traceback** )  
68 # To get the full stack trace, call:  
69 # `tf.debugging.disable_traceback_filtering()`  
—\> 70 raise e.with\_traceback(filtered\_tb) from None  
71 finally:  
72 del filtered\_tb

File /opt/conda/lib/python3.10/site-packages/tensorflow/python/saved\_model/loader\_impl.py:119, in parse\_saved\_model(export\_dir)  
117 raise IOError(f"Cannot parse file {path\_to\_pbtxt}: {str(e)}.“) from e  
118 else:  
 → 119 raise IOError(  
120 f"SavedModel file does not exist at: {export\_dir}{os.path.sep}”  
121 f"{{{constants.SAVED\_MODEL\_FILENAME\_PBTXT}|"  
122 f"{constants.SAVED\_MODEL\_FILENAME\_PB}}}")  
123 return saved\_model

OSError: SavedModel file does not exist at: /root/.cache/huggingface/hub/models–soufyane–gemma\_data\_science/snapshots/d9d2d8ce54328a7265c51f6a17d22df0880c2e4c/{saved\_model.pbtxt|saved\_model.pb}
