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

ModuleNotFoundError: No module named 'vision_transformer' #12

Closed
giulianobertoti opened this issue Jul 29, 2022 · 6 comments
Closed

ModuleNotFoundError: No module named 'vision_transformer' #12

giulianobertoti opened this issue Jul 29, 2022 · 6 comments

Comments

@giulianobertoti
Copy link

Hello, even installing the dependencies (pip install -r requirements.txt) I got the message "ModuleNotFoundError: No module named 'vision_transformer'" while executing "from HIPT_4K.hipt_4k import HIPT_4K". If you can tell me where I went wrong or how to import these "vision_transformer" library I would appreciate it. Thanks.

@Richarizardd
Copy link
Collaborator

the vision_transformer.py class is linked here.. Where are you calling your import statement?

@giulianobertoti
Copy link
Author

Hello, thank you.

I'm following the readme.md codes of this repository... I cloned the repository, installed the dependencies and when I ran the code below, the error I mentioned in the previous message happened in the first line of the code below:

from HIPT_4K.hipt_4k import HIPT_4K
from HIPT_4K.hipt_model_utils import eval_transforms

model = HIPT_4K()
model.eval()

region = Image.open('HIPT_4K/image_demo/image_4k.png')
x = eval_transforms()(region).unsqueeze(dim=0)
out = model.forward(x)

@giulianobertoti
Copy link
Author

Just complementing my previous message, follow the error image below (I cloned the repository and installed the dependencies normally)

image

@jjhbw
Copy link

jjhbw commented Aug 4, 2022

Maybe i'm confused, but I think the line that creates this error is not necessary and can be removed. See my pull request for details #5

@Richarizardd
Copy link
Collaborator

Hi @jjhbw - I see your pull request and close it soon.

@giulianobertoti - if this is still giving you trouble, as mentioned, the vision_transformer.py class is found here. You can try using sys to make sure that this file is in the correct import path. Let me know if there is a better fix.

@Rainydu184
Copy link

from . import vision_transformer

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