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 'lib' #38

Closed
zhanglichao opened this issue Sep 30, 2021 · 2 comments
Closed

ModuleNotFoundError: No module named 'lib' #38

zhanglichao opened this issue Sep 30, 2021 · 2 comments

Comments

@zhanglichao
Copy link

hi,

I run several times about vot (python version), but still got the problem:
from lib.test.vot20.stark_vot20 import run_vot_exp
ModuleNotFoundError: No module named 'lib'

It seems not finding the stark project path, though I export it as:
export PYTHONPATH=/home/xxxx/projects/transformer/Stark-main:$PYTHONPATH.

Expected to solve it by inspiring from any of your answers.

Thanks!

@Stoooner
Copy link

Stoooner commented Apr 6, 2022

你需要在lib/test/vot20/stark_st50.py文件的from lib.test.vot20.stark_vot20 import run_vot_exp语句之前添加下面的代码就可以解决这个问题了:

prj_path = os.path.join(os.path.dirname(__file__), '../../../')
if prj_path not in sys.path:
    sys.path.append(prj_path)

添加上了上面的代码之后就可以正常执行bash exp.sh语句了, 下面是正常测试VOT20的部分显示结果:

Loading dataset      |██████████████████████████████████████████████████████| 100% [00:00<00:00]
Loaded workspace in '.'
Scanning registry /home/stoner/vscode_workplace/Stark/external/vot20/stark_st50/trackers.ini
Found 1 trackers

Found data for 1 trackers
Evaluating tracker stark_st50
                      |                                                    |   0% [00:00<?]Running process: /usr/bin/python3 -m stark_st50
 stark_st50/baseline  ||   1% [00:25<1:14:53]Running process: /usr/bin/python3 -m stark_st50
 stark_st50/baseline  ||   1% [00:39<56:28]Running process: /usr/bin/python3 -m stark_st50
 stark_st50/baseline  ||   2% [00:59<56:40]Running process: /usr/bin/python3 -m stark_st50
 stark_st50/baseline  ||   2% [01:48<1:57:16]Running process: /usr/bin/python3 -m stark_st50
 stark_st50/baseline  ||   2% [02:30<2:38:46]Running process: /usr/bin/python3 -m stark_st50
 stark_st50/baseline  |█▏                                                  |   2% [03:06<3:00:06]Running process: /usr/bin/python3 -m stark_st50
 stark_st50/baseline  |█▎                                                  |   3% [03:36<3:06:12]Running process: /usr/bin/python3 -m stark_st50

@MasterBin-IIAU
Copy link
Collaborator

@Stoooner Thanks for helping to solve this problem :)

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