keras2caffe icon indicating copy to clipboard operation
keras2caffe copied to clipboard

Exception: Unsupported layer type: ReLU

Open mrgransky opened this issue 4 years ago • 1 comments

trying the code with MobileNet, I face the following error;

Traceback (most recent call last):
  File "convert.py", line 35, in <module>
    keras2caffe.convert(keras_model, caffe_proto, caffe_weights)
  File "../../keras2caffe/convert.py", line 390, in convert
    raise Exception('Unsupported layer type: '+layer_type)
Exception: Unsupported layer type: ReLU

Is there any fix for this layer? Cheers,

mrgransky avatar Aug 11 '20 09:08 mrgransky

The script convert.py is basically a long series of ifs and elifs. The error message means that there is no "if layer_type=='ReLU'". You can add this and the correct line for adding the right caffe layer.

However, there is a "if layer_type=='Activation'" (line 273), so you could change the ReLU layer in your keras code to an activation layer with activation function ReLU.

JayDommaschk avatar Aug 18 '20 07:08 JayDommaschk