meituan / YOLOv6

YOLOv6: a single-stage object detection framework dedicated to industrial applications.
GNU General Public License v3.0
5.72k stars 1.03k forks source link

yolov6_utils.py,how can i issue this problem? #574

Open krida1 opened 2 years ago

krida1 commented 2 years ago

Before Asking

Search before asking

Question

Traceback (most recent call last): File "prepare_slicing_traindata.py", line 7, in from yolov6.utils.slicing import get_slice_bboxes, annotation_inside_slice ModuleNotFoundError: No module named 'yolov6.utils'

Additional

Traceback (most recent call last): File "prepare_slicing_traindata.py", line 7, in from yolov6.utils.slicing import get_slice_bboxes, annotation_inside_slice ModuleNotFoundError: No module named 'yolov6.utils'

Chilicyy commented 2 years ago

Before starting, you can add the directory path of YOLOv6 to PYTHONPATH by export PYTHONPATH=$your_YOLOv6_dir:$PYTHONPATH.

krida1 commented 2 years ago

PYTHONPATH=$your_YOLOv6_dir:$PYTHONPATH 是这个意思吗,为什么还是没有用呢 $E:\Desktop\yolo\YOLOv6:$PYTHONPATH image

Chilicyy commented 2 years ago

@krida1 hi, 在网上找到一个设置pycharm中设置Pythonpath的教程,你可以试试:

1、File->Setting

2、Project:XXX->Project Interpreter

3、在右边的Project Interpreter的下拉框中选择Show All...

4、在弹出的对话框中,点击右边“Show paths for the selected interpreter”对应的按钮。

5、在新弹出的对话框中,点击‘+’对应的按钮,添加新的路径(“Interpreter Paths”)。 ———————————————— 版权声明:本文为CSDN博主「roughman9999」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/roughman9999/article/details/79458262

krida1 commented 2 years ago

Traceback (most recent call last): File "tools/train.py", line 10, in from yolov6.core.engine import Trainer ModuleNotFoundError: No module named 'yolov6.core' 添加了这行代码都没有,还有把yolov6设置成了根目录也不行,是哪里有问题呢 ROOT = os.getcwd() if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT))

sys.path.append('/opt/data/private/github/yolo/YOLOv6/')

shensheng272 commented 2 years ago

可以先试下在命令行下是否可以执行。 如果命令行可以执行,则应该是pyrcharm路径配置问题,可以单独搜索相关的信息。大概率是设置工作目录的问题

krida1 commented 2 years ago

命令行也不可以运行,就只可以右键运行才不会报错

wysunrise2 commented 1 year ago

@krida1 hi, 在网上找到一个设置pycharm中设置Pythonpath的教程,你可以试试:

1、File->Setting

2、Project:XXX->Project Interpreter

3、在右边的Project Interpreter的下拉框中选择Show All...

4、在弹出的对话框中,点击右边“Show paths for the selected interpreter”对应的按钮。

5、在新弹出的对话框中,点击‘+’对应的按钮,添加新的路径(“Interpreter Paths”)。 ———————————————— 版权声明:本文为CSDN博主「roughman9999」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/roughman9999/article/details/79458262

看了下文件目录结构,这里的yolov6模块应该指的是和tools文件夹同层的yolov6文件夹,把这个yolov6文件夹复制到tools文件夹内,它就可以直接被访问到了。如图 image