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

Bug: use_cuda still exist in swin transformer example code #504

Open
chilin0525 opened this issue May 31, 2024 · 2 comments
Open

Bug: use_cuda still exist in swin transformer example code #504

chilin0525 opened this issue May 31, 2024 · 2 comments

Comments

@chilin0525
Copy link

Hi,

I found model parameter use_cuda already removed in the commit: 00711a2, but in usage_examples/swinT_example.py still use use_cuda. So the user may got error when running the example code.

Steps to Reproduce:

$ python3 usage_examples/swinT_example.py

Using CPU for computation
Exception ignored in: <function BaseCAM.__del__ at 0x7fa71550f820>
Traceback (most recent call last):
  File "/home/chilin/.pyenv/versions/pytorch_grad_cam/lib/python3.9/site-packages/pytorch_grad_cam/base_cam.py", line 196, in __del__
    self.activations_and_grads.release()
AttributeError: 'ScoreCAM' object has no attribute 'activations_and_grads'
Traceback (most recent call last):
  File "/home/chilin/pytorch-grad-cam/usage_examples/swinT_example.py", line 104, in <module>
    cam = methods[args.method](model=model,
TypeError: __init__() got an unexpected keyword argument 'use_cuda'

The code execute successfully after removing the parameter, I will create a MR to fix it ! Just leave the issue for someone confused about the error.

@wap1024
Copy link

wap1024 commented Jun 3, 2024

Hello, may I ask how to modify it?

@chilin0525
Copy link
Author

@wap1024 sure, I already create a MR(#505) to fix it. You can see change in MR how to fix it, remove use_cuda of model interface should work

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

2 participants