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

Error: cannot import name 'intersect_dicts' from 'yolov5.utils.torch_utils when using icevision==0.12.0 with yolov5==6.2.3 #1153

Open
rafaelvp-db opened this issue Nov 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@rafaelvp-db
Copy link

🐛 Bug

Describe the bug

When trying to use yolov5==6.2.3 with icevision==0.12.0 I get the following error:

8 from yolov5.models.yolo import Model
      9 from yolov5.utils.downloads import attempt_download
---> 10 from yolov5.utils.torch_utils import intersect_dicts
     11 from yolov5.utils.general import check_img_size
     12 from icevision.models.ultralytics.yolov5.utils import *

ImportError: cannot import name 'intersect_dicts' from 'yolov5.utils.torch_utils' (/databricks/python/lib/python3.8/site-packages/yolov5/utils/torch_utils.py)

To Reproduce
Steps to reproduce the behavior:

  1. Install icevision==0.12.0 and yolov5==6.2.3
  2. Try to instantiate icevision.parsers.COCOBBoxParser

Expected behavior
COCOBBoxParser is instantiated correctly

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • ubuntu 18.04

Additional context
I'm trying to replicate the exact same architecture available from ultralytics.yolov5 for inference (mainly because I want to run inference on raw images, without having to declare a Dataset or DataLoader. The reason for this is to deploy an object detection as a REST API endpoint.

@rafaelvp-db rafaelvp-db added the bug Something isn't working label Nov 8, 2022
@fcakyon
Copy link
Contributor

fcakyon commented Nov 13, 2022

It's in utils.general in the latest versions: https://github.com/ultralytics/yolov5/blob/fde77584687041aa62795bb2c27e895cf73686bf/utils/general.py#L242

But icevision should be used with yolov5-icevision package I believe:

yolov5-icevision >=6.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants