JDAI-CV / fast-reid

SOTA Re-identification Methods and Toolbox
Apache License 2.0
3.39k stars 830 forks source link

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

Closed edwardnguyen1705 closed 1 month ago

edwardnguyen1705 commented 2 months ago

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.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.