天天看點

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_file
    current_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_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<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_exp
    return get_exp_by_file(exp_file)
  File "E:\YOLO_X\yolox\exp\build.py", line 16, in get_exp_by_file
    raise 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出錯