Comments (3)
@nilesh-sengupta Please use the appropriate loading function based on the saving format. For example, tf.keras.models.load_model for HDF5 and tf.saved_model.load for SavedModel.
Thank you!
from tensorflow.
@sushreebarsa The model is in .keras format, it is saved using model.save('model_name.keras'), loading it using tf.saved_model.load gives the following exception:
Traceback (most recent call last):
File "/usr/local/bin/mldnn/dnn_1.6/predictor.py", line 26, in
model = tf.saved_model.load('deep_neural_network.keras')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/model_training/lib/python3.11/site-packages/tensorflow/python/saved_model/load.py", line 912, in load
result = load_partial(export_dir, None, tags, options)["root"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/model_training/lib/python3.11/site-packages/tensorflow/python/saved_model/load.py", line 1016, in load_partial
loader_impl.parse_saved_model_with_debug_info(export_dir))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/model_training/lib/python3.11/site-packages/tensorflow/python/saved_model/loader_impl.py", line 59, in parse_saved_model_with_debug_info
saved_model = parse_saved_model(export_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/model_training/lib/python3.11/site-packages/tensorflow/python/saved_model/loader_impl.py", line 119, in parse_saved_model
raise IOError(
OSError: SavedModel file does not exist at: deep_neural_network.keras/{saved_model.pbtxt|saved_model.pb}
The previous error is encountered while using tf.keras.models.load_model
from tensorflow.
@nilesh-sengupta
Could you try to re-save your Keras model as a SavedModel:
tf.saved_model.save(model, 'path/to/save/model') # Use a distinct path to avoid overwriting
Since your model is in the .keras format, please use tf.keras.models.load_model to load it:
model = tf.saved_model.load('path/to/save/model')
This function is specifically designed to handle models saved in the Keras format.
Thank you!
from tensorflow.
Related Issues (20)
- Tensorflow not detecting GPU HOT 3
- `SystemError` in `tf.ensure_shape` and `tf.compat.v1.ensure_shape` when `dtype` of `shape` is `tf.uint64` and its value is too large. HOT 2
- Unknown operation used in model that is not explicitly declared HOT 1
- tf.linalg.normalize generates wrong output in tflite version running on mobile GPU HOT 3
- `SystemError` in `tf.signal.frame` when `dtype` of `frame_step` is `tf.uint64` and its value is too large. HOT 1
- TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases HOT 1
- `SystemError` in `tf.raw_ops.ParallelConcat` when `dtype` of `shape` is `tf.qint16` or `tf.quint16`. HOT 4
- Please cherry-pick a73ce1c2ac0a951e46dda8aa2d82a8352233031a to 2.16.1 HOT 3
- TensorFlow build error under windows HOT 4
- No optimized fast float implementation for `Logistic` HOT 5
- Cannot build TFLite 2.16.1 for RISC-V due to the bug in cpuinfo (missing sys/hwprobe.h)
- Feature Request: Integrate different Digital Signal Processing into tf.signal HOT 1
- GPU delegate linker errors when building TFLite 2.16.1 for Android with CMake HOT 6
- illegal hardware instruction HOT 2
- error: missing attribute 'value` when converting HOT 1
- tf.linalg.cross convert to tflite HOT 1
- When performing inference, the error 'DNN library not found.' occurs intermittently. HOT 2
- tensorflow gpu HOT 9
- how to use tfLite c_api HOT 1
- load_model no longer works with Dot layer in TensorFlow 2.16 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.