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

No model found in config file #12

Open
tomguluson92 opened this issue Sep 12, 2018 · 3 comments
Open

No model found in config file #12

tomguluson92 opened this issue Sep 12, 2018 · 3 comments

Comments

@tomguluson92
Copy link

Hi, I just use the command line as you mentioned, and raise this error.

My System Setting is:

  • keras-preprocessing 1.0.2
  • keras-applications 1.0.4
  • keras 2.2.2
  • tensorflow-gpu 1.9.0
Using TensorFlow backend.
Traceback (most recent call last):
  File "/home/samuel/anaconda3/bin/keras-compressor.py", line 68, in <module>
    main()
  File "/home/samuel/anaconda3/bin/keras-compressor.py", line 53, in main
    model = load_model(args.model)  # type: keras.models.Model
  File "/home/samuel/anaconda3/lib/python3.6/site-packages/keras/engine/saving.py", line 258, in load_model
    raise ValueError('No model found in config file.')
ValueError: No model found in config file.

Really Hope your reply, Thank you very much!

@tomguluson92
Copy link
Author

The command i use is:
~/dev/keras_compressor$ keras-compressor.py --error 0.001 ./encoder.h5 ./compressed.h5

@dlueder
Copy link

dlueder commented Sep 19, 2018

Same here with python 3.6.6, Keras 2.1.5, TensorFlow 1.8.0

@karanahujax
Copy link

I changed the following in the keras_compressor.py. You need to read your json file as well:

json_file = open(args.model.replace(".h5",".json"), 'r')
loaded_model_json = json_file.read()
json_file.close()
model = model_from_json(loaded_model_json)
model.load_weights(args.model)

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