Closed RRathna closed 6 years ago
This sounds like a version issue. What version of Python, Keras, etc are you using?
python 3.6.4 keras 1.2.2 tensorflow 0.12.1 h5py 2.7.1
Just to be clear, I'm not the author of YAD2K and I only hacked it to get it to work with Keras 1.x. ;-)
It worked with my setup (which I think included TensorFlow 1.x and Python 2) and I think it's either the Python version or TensorFlow version that gives this error for you.
However, now that coremltools supports Keras 2, it might be worth updating this code to use the latest YAD2K.
Hey! It is a version issue, should use python2.7 instead of 3. Thanks!
@RRathna I get the same error with my own model, but according to this repo we should use python 3 - where exactly did you switch to python2 to solve this problem?
Error Message: Traceback (most recent call last): File "yad2k.py", line 271, in
_main(parser.parse_args())
File "yad2k.py", line 263, in _main
print('Warning: {} unused weights'.format(len(remaining_weights)))
TypeError: object of type 'float' has no len()
Possible correction/suggestion: In line 263 replace,
print('Warning: {} unused weights'.format(len(remaining_weights)))
with
print('Warning: {} unused weights'.format(remaining_weights))