gmalivenko / onnx2keras

Convert ONNX model graph to Keras model format.
MIT License
193 stars 114 forks source link

Missing converter for LRN #62

Closed igormp closed 4 years ago

igormp commented 4 years ago

After trying to convert the AlexNet model from onnx (found here), I got the following error:

KeyError                                  Traceback (most recent call last)
 in 
      1 onnx_model = onnx.load('bvlcalexnet-9.onnx')
      2 print("onnx model loaded")
----> 3 model = onnx_to_keras(onnx_model, ['data_0'])

~/.local/lib/python3.8/site-packages/onnx2keras/converter.py in onnx_to_keras(onnx_model, input_names, input_shapes, name_policy, verbose, change_ordering)
    172             logger.debug('... found all, continue')
    173 
--> 174         AVAILABLE_CONVERTERS[node_type](
    175             node,
    176             node_params,

KeyError: 'LRN'

Any ideas on how to get this to work?

vibhuagrawal14 commented 4 years ago

I'm getting the same error. Were you able to get this to work somehow?

gmalivenko commented 4 years ago

Hello @igormp , @vibhuagrawal14 . I will add support of this layer in the nearest future.

gmalivenko commented 4 years ago

I added experimental support of LRN.

@igormp during testing the model bvlcalexnet-9.onnx was converted with error value: 0.0005662161, please update onnx2keras package and try to convert the model again.

igormp commented 4 years ago

Tried it out quickly and everything seems to be ok. Thanks for the fix!