Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yolov5 family models conversion failed.. #863

Open
wxthu opened this issue May 15, 2023 · 2 comments
Open

yolov5 family models conversion failed.. #863

wxthu opened this issue May 15, 2023 · 2 comments

Comments

@wxthu
Copy link

wxthu commented May 15, 2023

I wanna accelerate yolov5 inference using tensorrt, However, when I convert pytorch format to tensorrt format, I met the following error. It seems that conversion failed . Could you give me some suggestions?
image

my code:

# conversion
  model = torch.hub.load('ultralytics/yolov5', 'yolov5s').eval().cuda()
  im = torch.rand(1, 3, 640, 640).cuda()
  model_trt = torch2trt(model, [im])
  
  # execution
  for _ in range(20):
      y = model_trt(im)

  times = 500
  start = time_sync()
  for _ in range(times):
      y = model_trt(im)
  end = time_sync()
  print("Average latency after accis {} ms".format((end - start) * 1000 / times))`
```

tensorrt version: 7.0.0.11
pytorch: 1.8.1
cuda: 10.2
python: 3.7.16
@wxthu
Copy link
Author

wxthu commented May 15, 2023

@koenvandesande

@wxthu
Copy link
Author

wxthu commented May 16, 2023

I found that when I change the batch size from 1 to other value , then conversion and inference could be finished successfully . I am confused .... @chitoku @koenvandesande @oliver-batchelor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant