YuvalNirkin / hyperseg

HyperSeg - Official PyTorch Implementation
https://nirkin.com/hyperseg
Creative Commons Zero v1.0 Universal
210 stars 39 forks source link

No module named 'hyper_seg' #12

Closed leo-hao closed 3 years ago

leo-hao commented 3 years ago

Because the training failed, I tried to download cityscapes_efficientnet_b1_hyperseg-m.pth to hyperseg/weights, and renamed it to model_best.pth, I try python test.py 'weights' \ -td "hyper_seg.datasets.cityscapes.CityscapesDataset('data/cityscapes',split='val',mode='fine')"\ -it "seg_transforms.LargerEdgeResize([512,1024])" \ --gpus 0 image Looking forward to your reply!

YuvalNirkin commented 3 years ago

You need to add the parent directory of the repository to PYTHONPATH. That will be ~/Documents/code in your case.

leo-hao commented 3 years ago

Dear doctor Nirkin, thank you for your reply on this question. In fact, I added the following sentence into the environment variable before training export PYTHONPATH=$PYTHONPATH:/home/data/userleo/Documents/code

And I just tried to add export PYTHONPATH=$PYTHONPATH:~/Documents/code export PYTHONPATH=$PYTHONPATH:/Documents/code Then, I source ~/.bashrc

run the test order But still the same error.

Looking forward to your reply!

leo-hao commented 3 years ago

Dear doctor Nirkin, I found the error after reading the code. The test command you gave in the README.md file does not require an underscore.

YuvalNirkin commented 3 years ago

I fixed the README, thanks!

xings-sdnu commented 2 years ago

Hi, I have the same problem, how did you add the directory to the PythonPath, please?