keras_compressor
                                
                                
                                
                                    keras_compressor copied to clipboard
                            
                            
                            
                        No model found in config file
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!
The command i use is:
~/dev/keras_compressor$ keras-compressor.py --error 0.001 ./encoder.h5 ./compressed.h5
Same here with python 3.6.6, Keras 2.1.5, TensorFlow 1.8.0
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)