I trained my arcface model using arcface mxnet with fp16 precision. Training code:
CUDA_VISIBLE_DEVICES='0,1,2,3,4,5' python -u train_parall.py --network r100 --loss arcface --dataset webface --fp16-scale 1.0
After finish training, I tried to convert it to onnx format using mxnet's onnx converter. Code:
import onnx
import mxnet as mx
from onnx import helper
from mxnet import onnx as onnx_mxnet
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:
I trained my arcface model using arcface mxnet with fp16 precision. Training code:
CUDA_VISIBLE_DEVICES='0,1,2,3,4,5' python -u train_parall.py --network r100 --loss arcface --dataset webface --fp16-scale 1.0
After finish training, I tried to convert it to onnx format using mxnet's onnx converter. Code:
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')
mxnet==1.9.0 onnx==1.8.0