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

运行 train.py时报错 #4

Open
lucas2606-rs opened this issue Sep 4, 2022 · 1 comment
Open

运行 train.py时报错 #4

lucas2606-rs opened this issue Sep 4, 2022 · 1 comment

Comments

@lucas2606-rs
Copy link

Traceback (most recent call last):
File "D:/论文代码书/代码/高光谱影像分类/全卷积FCN/FreeNet-master/train.py", line 60, in
train.run(config_path=args.config_path,
File "D:\Anaconda\envs\Pytorch\lib\site-packages\simplecv-0.3.4-py3.8.egg\simplecv\dp_train.py", line 29, in run
cfg = config.import_config(config_path)
File "D:\Anaconda\envs\Pytorch\lib\site-packages\simplecv-0.3.4-py3.8.egg\simplecv\util\config.py", line 5, in import_config
m = importlib.import_module(name='{}.{}'.format(prefix, config_name))
File "D:\Anaconda\envs\Pytorch\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'configs.None'

@lucas2606-rs
Copy link
Author

已解决
不能直接运行train.py,需要运行三个后缀为sh的脚本文件
所以问题的本质变成了在windows环境下运行作者的sh脚本
在将数据按指定文件夹存放后,需要通过git bash 运行脚本文件
但是会出现2个问题,第一个问题是运行完成后,git bash窗口闪退
这个可以通过在脚本文件末尾加上以下代码解决
echo 按任意键继续
read -n 1
echo 继续运行

然后你会发现第二个问题,git bash无法找到train.py/无法找到数据
原因是作者的sh脚本都放在scripts子文件夹中,所以无法找到train.py和数据
把sh脚本复制到freenet-master主文件夹下,再运行即可

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

1 participant