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

save as pb #22

Open
zhenglongjiepheonix opened this issue Nov 4, 2020 · 6 comments
Open

save as pb #22

zhenglongjiepheonix opened this issue Nov 4, 2020 · 6 comments

Comments

@zhenglongjiepheonix
Copy link

hey, i am using model.save as you mentioned so that i could get .pb file, but it turns out that i only get a file without any suffixes which is not in pb format

@zhenglongjiepheonix
Copy link
Author

according to the official documents, it could only be saved as h5 or tf format, how it could be saved as pb format

@tyagi-iiitv
Copy link
Owner

tyagi-iiitv commented Nov 5, 2020 via email

@zhenglongjiepheonix
Copy link
Author

I even tried to convert h5 to pb but when I use model.save() to save the file as "model.h5" , and later try to load using load_model("model.h5"), some error occurs. I think it would be better to implement in TF 1.x framework instead of using high level API like keras, since TF 1.x seems to support pb file better

@zhenglongjiepheonix
Copy link
Author

After all pb file is more important for deployment and acceleration

@tyagi-iiitv
Copy link
Owner

I think to load the model without using Keras, use tf.saved_model.load('model_directory'). It worked fine for me when I loaded my saved pb model.

@Manueljohnson063
Copy link

Hai when i train the model i got the error
Traceback (most recent call last):
File "point_pillars_training_run.py", line 26, in
pillar_net.load_weights(os.path.join(MODEL_ROOT, "model.h5"))
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py", line 2227, in load_weights
with h5py.File(filepath, 'r') as f:
File "/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py", line 408, in init
swmr=swmr)
File "/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py", line 173, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 88, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = './logs/model.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

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

No branches or pull requests

3 participants