scene-text-recognition icon indicating copy to clipboard operation
scene-text-recognition copied to clipboard

Error when converting the detector to TRT

Open andresgalaviz opened this issue 2 years ago • 4 comments

I followed instructions provided here: https://forums.developer.nvidia.com/t/object-detection-with-jetson-nano/198189 and was able to get the labeled images.

However, when trying to get the output from the RealSense I get this error and no output:

~/scene-text-recognition$ python3 video_capture.py
/home/xxxxxx/.local/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)
Warning: Encountered known unsupported method torch.zeros
Warning: Encountered known unsupported method torch.Tensor.__hash__
Warning: Encountered known unsupported method torch.Tensor.__hash__
...
Warning: Encountered known unsupported method torch.Tensor.__hash__
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
Finished converting detector to TRT
Testing TRT Model Difference:
tensor(1.4901e-07, device='cuda:0', grad_fn=<MaxBackward1>)
tensor(1.0014e-05, device='cuda:0', grad_fn=<MaxBackward1>)

andresgalaviz avatar Mar 08 '22 01:03 andresgalaviz

As an update to this, and after following a few of the suggestions in the current repo's issues: I was able to run my own test against file images using the use_trt flag. However, I still get the same warnings as above when converting the detector to TRT. I don't get any errors, but no text is detected/recognized on test images (Which have been successfully tested using the GPU version of EasyOCR).

My board's info: image

andresgalaviz avatar Apr 29 '22 21:04 andresgalaviz

As an update to this, and after following a few of the suggestions in the current repo's issues: I was able to run my own test against file images using the use_trt flag. However, I still get the same warnings as above when converting the detector to TRT. I don't get any errors, but no text is detected/recognized on test images (Which have been successfully tested using the GPU version of EasyOCR).

My board's info: image

have you solved this issue? I'm currently struggling with the same issue

gyusik19 avatar Sep 07 '22 04:09 gyusik19

are you able to solve this issue \

Mu23rad avatar Sep 12 '22 12:09 Mu23rad

I could fix it following https://github.com/NVIDIA-AI-IOT/scene-text-recognition/issues/1#issuecomment-998527101 the answer in this issue, however when using TRT I get no text detection/recognition at all

Currently running JetPack 5.0.2, CUDA 11.4, TensorRT 8.4.2.1, PyTorch 0.13 from JetPack download center and torchvision 0.4

AlbertoOddness avatar Nov 06 '22 19:11 AlbertoOddness