AirLine icon indicating copy to clipboard operation
AirLine copied to clipboard

Questions about the inference code (need model.eval())

Open BaofengZan opened this issue 9 months ago • 4 comments

I use the ‘Airline_demo.py’ to test the images and the original file can get normal results. But when I add Premodel.eval(), the result is 0(other parameters remain the same).

without model.eval() image

with model.eval() image

BaofengZan avatar May 07 '24 01:05 BaofengZan

hmmmm, I had not tested this though, this may affect some normalization but I am not sure. if no .eval() works then I recommend to just leave it so?

Lx017 avatar May 07 '24 01:05 Lx017

When I export onnx using torch.onnx.export, the bn layer exports in eval mode by default, If the onnxruntime inference is used, the result is incorrect. But when I export the bn layer in TRAINING mode, when converting to tensorrt, it will prompts that the BN layer is in TRAINING mode, which makes it impossible to convert. So I think I still need to check this issue.

Error when converting tensorrt。Official Answers: https://github.com/NVIDIA/TensorRT/issues/3457#issuecomment-1817477998 image

BaofengZan avatar May 07 '24 01:05 BaofengZan

yeah sorry, that is indeed something we missed...

Lx017 avatar May 07 '24 01:05 Lx017

Thank you, I look forward to you being able to solve this problem.

BaofengZan avatar May 07 '24 01:05 BaofengZan