本文主要是介绍pycharm运行YOLOX出错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
出错记录:ImportError: exps/example/custom/yolox_s.py doesn't contains class named 'Exp'
Traceback (most recent call last):File "E:\YOLO_X\yolox\exp\build.py", line 13, in get_exp_by_filecurrent_exp = importlib.import_module(os.path.basename(exp_file).split(".")[0])File "D:\Anconda\Anacondaanzhuang\envs\pytorch\lib\importlib\__init__.py", line 126, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)File "<frozen importlib._bootstrap>", line 1050, in _gcd_importFile "<frozen importlib._bootstrap>", line 1027, in _find_and_loadFile "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'yolox_s'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "E:\YOLO_X\tools\train.py", line 126, in <module>exp = get_exp(args.exp_file, args.name)File "E:\YOLO_X\yolox\exp\build.py", line 40, in get_expreturn get_exp_by_file(exp_file)File "E:\YOLO_X\yolox\exp\build.py", line 16, in get_exp_by_fileraise ImportError("{} doesn't contains class named 'Exp'".format(exp_file))
ImportError: exps/example/custom/yolox_s.py doesn't contains class named 'Exp'进程已结束,退出代码1
解决方法:只需要将tools里面的三个文件夹,复制到文件的根目录里面就可以啦。在根目录运行train.py文件,就可以继续啦。
这篇关于pycharm运行YOLOX出错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!