NVIDIA-AI-IOT / scene-text-recognition

Other
36 stars 14 forks source link

examples don't work with 'use_trt' option on AGX #1

Closed gitwavelet closed 2 years ago

gitwavelet commented 2 years ago

Hello,

The examples work well without 'use_trt' option.

But when using TRT, it doesn't detect any 'text' regions. I also tried "https://github.com/NVIDIA-AI-IOT/torch2trt" which merged the PR of jp4.6_tensorrt8 yesterday. The 'detector_trt.pth' model file is generated successfully with no errors but some warnings below.

Warning: Encountered known unsupported method torch.zeros Warning: Encountered known unsupported method torch.Tensor.hash ................... Warning: Encountered known unsupported method torch.Tensor.get_device Warning: Encountered known unsupported method torch.Tensor.is_complex

My Environment : Jetson AGX Xavier JetPack 4.6.1 python 3.6.9 python tensorrt 8.0.1.6

The terminal messages are following. It doesn't show any error messages.

python3 video_capture.py Loading TRT detector Testing TRT Model Difference: ..lib/python3.6/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /media/nvidia/NVME/pytorch/pytorch-v1.9.0/c10/core/TensorImpl.h:1156.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) tensor(0.0144, device='cuda:0', grad_fn=) tensor(1.7214, device='cuda:0', grad_fn=)

Any help is welcome. Thanks,

gitwavelet commented 2 years ago

I solved this by modifying EasyOCR/easyocr/detection.py like below. The count was '1' on AGX.

diff.txt