mkang315 / BGF-YOLO

[MICCAI'24] Official implementation of "BGF-YOLO: Enhanced YOLOv8 with Multiscale Attentional Feature Fusion for Brain Tumor Detection".
GNU Affero General Public License v3.0
70 stars 11 forks source link

When running "python yolo/bgf/detect/train.py", I encountered the above problem. How to solve it? #10

Open Kao404 opened 4 months ago

Kao404 commented 4 months ago

Traceback (most recent call last): File "yolo/bgf/detect/train.py", line 7, in from ...nn.tasks import DetectionModel ImportError: attempted relative import with no known parent package

mkang315 commented 4 months ago

Please try the absolute directory path: from BGF-YOLO-main.nn.tasks import DetectionModel

ngocnh22 commented 2 months ago

Hello, when I run with your comment. It appears like that. from BGF-YOLO-main.nn.tasks import DetectionModel ^ SyntaxError: invalid syntax

how can I solve it?

mkang315 commented 1 month ago

You may try to put our code in the folder of 'ultralytics' of YOLOv8 and replace all the import dependencies with ultralytics.xxx.xxxx. Our code was generated based on that of YOLOv8.