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

cannot import name 'CAM' #65

Closed
SoroushF79 opened this issue Apr 5, 2021 · 7 comments
Closed

cannot import name 'CAM' #65

SoroushF79 opened this issue Apr 5, 2021 · 7 comments

Comments

@SoroushF79
Copy link

Running 'from pytorch_grad_cam import CAM' produces 'ImportError: cannot import name 'CAM' '

@jacobgil
Copy link
Owner

jacobgil commented Apr 5, 2021

Hi,
How did you install the package?

Can you please try
pip install -e .
After cloning the repo.

The pypi repo is not updated yet with the latest version - I asked access from one of the contributers that openned it, and in the meanwhile I can't push updates.
If it won't solve soon I will probably upload it to pypi with another name.

@AshishAJ1994
Copy link

Running 'from pytorch_grad_cam import CAM' produces 'ImportError: cannot import name 'CAM' '

Facing the same issue.

@AshishAJ1994
Copy link

Hi,
How did you install the package?

Can you please try
pip install -e .
After cloning the repo.

The pypi repo is not updated yet with the latest version - I asked access from one of the contributers that openned it, and in the meanwhile I can't push updates.
If it won't solve soon I will probably upload it to pypi with another name.

Is this resolved yet?

@jacobgil
Copy link
Owner

jacobgil commented Apr 6, 2021

Not yet.
You can install in the meanwhile with
pip install -e .
after cloning the repository.

In the next week I will probably open a new pypi repo.

@josepdecid
Copy link
Collaborator

josepdecid commented Apr 6, 2021

It should be fixed now, once pull request #66 is accepted, which updates the readme on how to install the library.

Meanwhile, remove the installed pytorch-grad-cam package and try to install it with pip install grad-cam instead of pip install pytorch-grad-cam and try to import CAM as you were doing before, with

from pytorch_grad_cam import CAM

I hope that it works now!

@SoroushF79
Copy link
Author

Importing CAM after doing pip install grad-cam works. Thanks!

@jacobgil
Copy link
Owner

jacobgil commented Apr 6, 2021

Thanks! Closing, should be resolved now.

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

4 participants