fast-reid icon indicating copy to clipboard operation
fast-reid copied to clipboard

ONNX export mode is set to TrainingMode.EVAL, but operator 'instance_norm' is set to train=True

Open edwardnguyen1705 opened this issue 1 year ago • 0 comments
trafficstars

Dear @L1aoXingyu ,

Thanks for sharing a great work. I have been using this repo to train person embedding models.

When I convert to onnx, I observe a WARNING

$  python3 tools/deploy/onnx_export.py --config-file path/to/cfg_file

/usr/local/lib/python3.10/dist-packages/torch/onnx/symbolic_helper.py:1515: UserWarning: ONNX export mode is set to TrainingMode.EVAL, but operator 'instance_norm' is set to train=True. Exporting with train=True.

I also try torch2trt, and I observe the same behavior. Moreover, the difference between outputs of pytorch and tensorrt are quite different on a person reid dataset. I attach the scripts to produce the results. torch2trt.zip delta_y

I have googled and it shows that there are many persons having the same issue, I have tried some workarounds but they did not work, here is an example.

Have encountered this issue and figured out a way to tackle this? Thanks for your time.

edwardnguyen1705 avatar Jun 18 '24 07:06 edwardnguyen1705