HIPT
HIPT copied to clipboard
ModuleNotFoundError: No module named 'vision_transformer'
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.
the vision_transformer.py
class is linked here.. Where are you calling your import statement?
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)
Just complementing my previous message, follow the error image below (I cloned the repository and installed the dependencies normally)
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
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.
from . import vision_transformer