HIPT icon indicating copy to clipboard operation
HIPT copied to clipboard

ModuleNotFoundError: No module named 'vision_transformer'

Open giulianobertoti opened this issue 2 years ago • 4 comments

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.

giulianobertoti avatar Jul 29 '22 19:07 giulianobertoti

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

Richarizardd avatar Aug 03 '22 04:08 Richarizardd

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 avatar Aug 03 '22 17:08 giulianobertoti

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

image

giulianobertoti avatar Aug 03 '22 23:08 giulianobertoti

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

jjhbw avatar Aug 04 '22 12:08 jjhbw

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.

Richarizardd avatar Aug 22 '22 04:08 Richarizardd

from . import vision_transformer

Rainydu184 avatar Jun 30 '23 03:06 Rainydu184