onnx / keras-onnx

Convert tf.keras/Keras models to ONNX
Apache License 2.0
379 stars 109 forks source link

keras2onnx KeyError: 'apply_reducesum' #682

Open yoda07 opened 3 years ago

yoda07 commented 3 years ago

Hi Im trying to get my trained model .h5 file convert to .onnx file, while I follow the example run the python mask_rcnn.py <image_file_path> command, it throw an exception Traceback (most recent call last): File "C:/Users/yuda.AD/Desktop/keras-onnx/applications/mask_rcnn/mask_rcnn.py", line 684, in <module> oml = keras2onnx.convert_keras(model.keras_model, target_opset=11) File "C:\Users\yuda.AD\Desktop\keras-onnx\keras2onnx\main.py", line 105, in convert_keras return convert_topology(topology, name, doc_string, target_opset, channel_first_inputs) File "C:\Users\yuda.AD\Desktop\keras-onnx\keras2onnx\topology.py", line 312, in convert_topologycvt(scope, operator, container) File "C:\Users\yuda.AD\Desktop\keras-onnx\keras2onnx\_builtin.py", line 1484, in convert_tf_sum_convert_tf_reduce_op(scope, operator, container, 'ReduceSum') File "C:\Users\yuda.AD\Desktop\keras-onnx\keras2onnx\_builtin.py", line 1458, in _convert_tf_reduce_opaxes=axes, keepdims=keepdims) File "C:\Users\yuda.AD\Desktop\keras-onnx\keras2onnx\common\onnx_ops.py", line 89, in apply_op_with_output apply_func = apply_operations[apply_func_name] KeyError: 'apply_reducesum' Process finished with exit code 1

Also in the requirements.txt it says onnxconverter-common>=1.8.0, however the latest version I can find is 1.7.0

Can someone help me with the issue please? Thx!

jiafatom commented 3 years ago

Can you try keras2onnx and onnxconverter-common master branch? Thanks.