deepinsight / deepinsight/insightface
[arcface_mxnet] Can't convert arcface fp16 model to onnx format.
- Dominant language
- Python
- Stars
- 29.7k
- Forks
- 6.1k
- PR merge metrics
- No merged PRs in 30d
Description
- 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:

- Can you help me ? Thanks for your help!
- Dependencies:
```
mxnet==1.9.0
onnx==1.8.0
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.