onnx / keras-onnx

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

yolov4 KeyError: 'conv2d3_W_new' #706

Open pythonlessons opened 3 years ago

pythonlessons commented 3 years ago

Hello,

I converted yolov4 keras model from TensorFlow-2.x-YOLOv3 to .onnx model, everything worked fine. Now following this tutorial https://mxnet.apache.org/versions/1.5.0/tutorials/onnx/super_resolution.html I tried to convert to mx model, and receiving the following error:

>>> sym, arg_params, aux_params = import_model('modelv3.onnx') 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\rokas\AppData\Roaming\Python\Python37\site-packages\mxnet\contrib\onnx\onnx2mx\import_model.py", line 59, in import_model
    sym, arg_params, aux_params = graph.from_onnx(model_proto.graph)
  File "C:\Users\rokas\AppData\Roaming\Python\Python37\site-packages\mxnet\contrib\onnx\onnx2mx\import_onnx.py", line 114, in from_onnx
    inputs = [self._nodes[i] for i in node.input]
  File "C:\Users\rokas\AppData\Roaming\Python\Python37\site-packages\mxnet\contrib\onnx\onnx2mx\import_onnx.py", line 114, in <listcomp>
    inputs = [self._nodes[i] for i in node.input]
KeyError: 'conv2d3_W_new'
>>>

what can be the problem?