DwangoMediaVillage / keras_compressor

Model Compression CLI Tool for Keras.
https://nico-opendata.jp/ja/casestudy/model_compression/index.html
157 stars 39 forks source link

No model found in config file #12

Open tomguluson92 opened 6 years ago

tomguluson92 commented 6 years ago

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

My System Setting is:

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 commented 6 years ago

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

dlueder commented 6 years ago

Same here with python 3.6.6, Keras 2.1.5, TensorFlow 1.8.0

karanahujax commented 5 years ago

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)