Open ooolky opened 1 year ago
解决✔
lauch.js
默认以当前文件作为起点,而相对引用必须一顶层目录一般就是main.py
为起点,不然会报错。main.py
为启动。发现:mag:
问题:question:
from . import yolov5_tools
cannot import name 'yolov5_tools' from partially initialized module 'crossbeam_detector' (most likely due to a circular import)(/home/nerc-likaiyuan/code/hcDet/crossbeam_detector/crossbeam_detector.py)
- 代码:
from . import yolov5_tools
- 报错:no_entry::
cannot import name 'yolov5_tools' from partially initialized module 'crossbeam_detector' (most likely due to a circular import)(/home/nerc-likaiyuan/code/hcDet/crossbeam_detector/crossbeam_detector.py)
解决✔
crossbeam_detector
。from .yolov5_tools import yolov5_tools
,最好一开始就避免重复命名。
from ..utils.datasets import letterbox
ImportError: attempted relative import with no known parent package