We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AttributeError
ScoreCAM
I encountered an AttributeError when using the ScoreCAM class from the pytorch_grad_cam package. The error message is as follows:
pytorch_grad_cam
`AttributeError: 'ScoreCAM' object has no attribute 'device'
In the ScoreCAM class, the line causing the error is: activation_tensor = activation_tensor.to(self.device)
activation_tensor = activation_tensor.to(self.device)
The ScoreCAM class should either:
Initialize self.device properly, or Avoid using self.device if it is not applicable.
One potential fix would be to pass device as a param to the constructor
Initialize a ScoreCAM object. Call the object with
The text was updated successfully, but these errors were encountered:
Hi, I can't reproduce this. ScoreCAM inherits from BaseCAM which does have a self.device attribute.
Could you please share more information - which version are you using ?
Sorry, something went wrong.
Version 1.4.8
This should be fixed in the latest releases. Could you please try upgrading the package ?
No branches or pull requests
Issue:
AttributeError
forScoreCAM
ClassDescription
I encountered an
AttributeError
when using theScoreCAM
class from thepytorch_grad_cam
package. The error message is as follows:`AttributeError: 'ScoreCAM' object has no attribute 'device'
Code Context
In the ScoreCAM class, the line causing the error is:
activation_tensor = activation_tensor.to(self.device)
Expected Behavior
The ScoreCAM class should either:
Initialize self.device properly, or
Avoid using self.device if it is not applicable.
Possible Solution:
One potential fix would be to pass device as a param to the constructor
Steps to Reproduce:
Initialize a ScoreCAM object.
Call the object with
The text was updated successfully, but these errors were encountered: