MMdnn icon indicating copy to clipboard operation
MMdnn copied to clipboard

Error when converting SphereFace from Caffe to Keras

Open guesalomon opened this issue 5 years ago • 4 comments

Hello, I am having issues with the conversion, the activation function PRelu is not supported by the KerasEmitter. How can I bypass this?

Keras version is 2.4.4 (Up-tp-date)

Thanks!

Using TensorFlow backend. Parse file [6b8d9febaa98422bb0d6df32128d2be0.pb] with binary format successfully. KerasEmitter has not supported operator [PRelu]. relu1_1 KerasEmitter has not supported operator [PRelu]. relu1_2 KerasEmitter has not supported operator [PRelu]. relu1_3 KerasEmitter has not supported operator [PRelu]. relu2_1 KerasEmitter has not supported operator [PRelu]. relu2_2 KerasEmitter has not supported operator [PRelu]. relu2_3 KerasEmitter has not supported operator [PRelu]. relu2_4 KerasEmitter has not supported operator [PRelu]. relu2_5 KerasEmitter has not supported operator [PRelu]. relu3_1 KerasEmitter has not supported operator [PRelu]. relu3_2 KerasEmitter has not supported operator [PRelu]. relu3_3 KerasEmitter has not supported operator [PRelu]. relu3_4 KerasEmitter has not supported operator [PRelu]. relu3_5 KerasEmitter has not supported operator [PRelu]. relu3_6 KerasEmitter has not supported operator [PRelu]. relu3_7 KerasEmitter has not supported operator [PRelu]. relu3_8 KerasEmitter has not supported operator [PRelu]. relu3_9 KerasEmitter has not supported operator [PRelu]. relu4_1 KerasEmitter has not supported operator [PRelu]. relu4_2 KerasEmitter has not supported operator [PRelu]. relu4_3 Target network code snippet is saved as [6b8d9febaa98422bb0d6df32128d2be0.py]. Traceback (most recent call last): File "/home//.local/bin/mmconvert", line 11, in sys.exit(_main()) File "/home//.local/lib/python3.5/site-packages/mmdnn/conversion/_script/convert.py", line 112, in _main dump_code(args.dstFramework, network_filename + '.py', temp_filename + '.npy', args.outputModel, args.dump_tag) File "/home//.local/lib/python3.5/site-packages/mmdnn/conversion/_script/dump_code.py", line 32, in dump_code save_model(MainModel, network_filepath, weight_filepath, dump_filepath) File "/home//.local/lib/python3.5/site-packages/mmdnn/conversion/keras/saver.py", line 2, in save_model model = MainModel.KitModel(weight_filepath) File "6b8d9febaa98422bb0d6df32128d2be0.py", line 59, in KitModel conv1_2_input = layers.ZeroPadding2D(padding = ((1, 1), (1, 1)))(relu1_1) NameError: name 'relu1_1' is not defined

guesalomon avatar May 30 '19 16:05 guesalomon

Hi @guesalomon, could you provide your model so I can add the [PRelu] Op and test the accuracy? Thanks

rainLiuplus avatar Jun 03 '19 09:06 rainLiuplus

The model and weights are available here:

https://drive.google.com/file/d/1_f1xoFw4g5FL1jRtCTzTO_cbMzgxJcQY/view?usp=sharing

guesalomon avatar Jun 03 '19 14:06 guesalomon

@guesalomon, [PReLU] has been added and you can have a try

rainLiuplus avatar Jun 05 '19 05:06 rainLiuplus

Hi,

I have the same issue with PReLU. According to rainLiuplus's comment, I was expecting to find the PReLU in the keras-emitter., but didn't. In which branch could I find that?

Thanks! -johann

JohannSchumann avatar Jul 19 '20 21:07 JohannSchumann