tensorflowjs_convertor fails during inverse transformation
See original GitHub issueTo get help from the community, check out our Google group.
tensorflow==1.8.0 Keras==2.1.4 @tensorflow/tfjs": “0.12.0” Google Chrome, Version 67.0.3396.99 (Official Build) (64-bit)
I’ve tried to convert yolo model to tensorflow.js and used keras-yolo3 script which build keras model from darknet cfg and weight files. And It works pretty well with keras. Then I convert [.h5] model to tensorflow.js using tenserflowjs_converter and got a strange error:
Error: A
Concatenate
layer requires inputs with matching shapes except for the concat axis. Got input shapes: [[null,0,0,128],[null,null,null,256]]
Seems that tfjs_converter set 0 shapes to UpSampling2D layer. I also investigated that tfjs_converters fails during inverse transformation with:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Shapes must be equal rank, but are 1 and 4 for ‘Assign_3’ (op: ‘Assign’) with input shapes: [16], [3,3,16,32].
I think It should be some consistency between this two processes.
To reproduce download yolo-tiny.cfg and yolo-tiny.weight :
1. git clone https://github.com/qqwweee/keras-yolo3
2. Run python convert.py yolo-tiny.cfg yolo-tiny.weights model_data/yolo-tiny.h5
3. tensorflowjs_converter --input_format=keras --output_format=tensorflowjs model_data/yolo-tiny.h5 model_data/tfjs
4. You could try load model with tfjs and you'll get my first error...
5. tensorflowjs_converter --input_format=tensorflowjs --output_format=keras model_data/tfjs/model.json model_data/smth.h5
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
FYI, the 1st error is fixed by https://github.com/tensorflow/tfjs-layers/pull/262, and the fix is available in the latest release of @tensorflow/tfjs version 0.12.3.
We will send a PR to fix the 2nd error soon.
@bielanm FYI, the latest release of the pip package of tensorflowjs (0.5.4) incorporates the fix to your 2nd issue.