deepinsight / insightface

State-of-the-art 2D and 3D Face Analysis Project
https://insightface.ai
22.17k stars 5.28k forks source link

[arcface_mxnet] Can't convert arcface fp16 model to onnx format. #1945

Open nhmnhat1997 opened 2 years ago

nhmnhat1997 commented 2 years ago

sym, arg_params, aux_params = mx.model.load_checkpoint('./r100-arcface-webface/model', 20) input_shape = (1,) + tuple([int(x) for x in '3,112,112'.split(',')] ) all_args = {} all_args.update(arg_params) all_args.update(aux_params) onnx_mxnet.export_model(sym, all_args, [input_shape], np.float32, './r100_arcface.onnx')


- It returns this error:
![image](https://user-images.githubusercontent.com/40227850/159461353-0a282634-f2f1-4159-a2c9-37139d95aa51.png)

- Can you help me ? Thanks for your help!

- Dependencies:

mxnet==1.9.0 onnx==1.8.0

anxiangsir commented 2 years ago

create a new fp32 symbol and cast params to fp32.