Shanshan7 / UniMOT

A framework to do MOT
0 stars 0 forks source link

ModuleNotFoundError: No module named 'detection' #20

Closed wc1229 closed 2 years ago

wc1229 commented 2 years ago

终端输入: python detection/det2d_onnx_inference.py -i /home/wc/wc/UniMOT/pof/images/1.jpg -o /home/wc/wc/UniMOT/pof/model/model_last.onnx 报错:

Traceback (most recent call last):
  File "detection/det2d_onnx_inference.py", line 8, in <module>
    from detection.yolov5.utils.augmentations import letterbox
ModuleNotFoundError: No module named 'detection'
wc1229 commented 2 years ago

在py文件开头添加:

import sys
sys.path.append('上层文件夹路径')

添加init.py文件,内容仿照以下格式

from . import mot
from . import detection

from .mot import *
from .detection import *
Shanshan7 commented 2 years ago

问题已解决。