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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

@torch.compiler.disable - AttributeError: module 'torch' has no attribute 'compiler' #5268

Open
sebastianfernandezgarcia opened this issue Apr 24, 2024 · 7 comments

Comments

@sebastianfernandezgarcia

Instructions To Reproduce the 馃悰 Bug:

  1. Full runnable code or full changes you made:
    In: detectron2/layers/nms.py''' and '''detectron2/layers/roi_align_rotated.py
    There is a new commit: '''181aae3'''

has included:
+@torch.compiler.disable

(see commit changes)

So, with torch==1.11.0
torchvision==0.12.0
(I am using them to run DiT) the code says now:

23 # Note: this function (nms_rotated) might be moved into 24 # torchvision/ops/boxes.py in the future ---> 25 @torch.compiler.disable 26 def nms_rotated(boxes: torch.Tensor, scores: torch.Tensor, iou_threshold: float): 27 """ AttributeError: module 'torch' has no attribute 'compiler'
  1. What exact command you run:
  2. Full logs or other relevant observations:
Error now with the code and version of torch

Expected behavior:

It should work. Since this comit, everthing is failing!

Environment:

I am using google colab
@RenaYoyo
Copy link

RenaYoyo commented Apr 24, 2024

The latest v0.6 is different from the previous v0.6. You can install the previous one to solve this problem, like pip install 'git+https://github.com/facebookresearch/detectron2.git@v0.6'

@vincent-legoll
Copy link

Or you can take the code from just before the commit that broke it:
pip install 'git+https://github.com/facebookresearch/detectron2.git@a59f05630a8f205756064244bf5beb8661f96180'
That's the workaround I used for LabGym.

@vvvvabc
Copy link

vvvvabc commented Apr 25, 2024

I have the same problem you have. I use torch==2.0.0.
I find torch.compiler.disable is used in pytorch versions 2.2 and above.you can upgrade you pytorch versions or try to change your detectron2 version.
I solve this problom by upgrading torch==2.2.0.

@Marlod390
Copy link

Or you can take the code from just before the commit that broke it: pip install 'git+https://github.com/facebookresearch/detectron2.git@a59f05630a8f205756064244bf5beb8661f96180' That's the workaround I used for LabGym.

I am using torch==2.0.0 and this works for me. Don鈥檛 forget to uninstall the current detecron2 before executing the command, otherwise an error will still appear.

@mancubus77
Copy link

Just wondering what CUDA versions and drivers are you using guys?
Doco is outdated, and has no info about latest versions

@ChrsBaur
Copy link

ChrsBaur commented Apr 29, 2024

I have the same problem you have. I use torch==2.0.0. I find torch.compiler.disable is used in pytorch versions 2.2 and above.you can upgrade you pytorch versions or try to change your detectron2 version. I solve this problom by upgrading torch==2.2.0.

What CUDA Version are you using? @vvvvabc @Marlod390 ?
I have the same issue.

@Marlod390
Copy link

@ChrsBaur cuda11.8

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

7 participants