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

No module named 'hyper_seg' #12

Closed
leo-hao opened this issue Sep 25, 2021 · 5 comments
Closed

No module named 'hyper_seg' #12

leo-hao opened this issue Sep 25, 2021 · 5 comments

Comments

@leo-hao
Copy link

leo-hao commented Sep 25, 2021

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
Copy link
Owner

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

@leo-hao
Copy link
Author

leo-hao commented Sep 26, 2021

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
Copy link
Author

leo-hao commented Sep 29, 2021

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.

@leo-hao leo-hao closed this as completed Sep 29, 2021
@YuvalNirkin
Copy link
Owner

I fixed the README, thanks!

@xings-sdnu
Copy link

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

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

3 participants