longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.54k stars 421 forks source link

ImportError: dynamic module does not define module export function (PyInit_cython_bbox) #46

Open lxtGH opened 6 years ago

lxtGH commented 6 years ago

python 3.6 torch 0.3.0 When I run the train.py lxt@slave-01:~/pytorch/yolo2-pytorch$ python train.py Traceback (most recent call last): File "train.py", line 8, in from darknet import Darknet19 File "/home/lxt/pytorch/yolo2-pytorch/darknet.py", line 9, in from utils.cython_bbox import bbox_ious, bbox_intersections, bbox_overlaps, anchor_intersections ImportError: dynamic module does not define module export function (PyInit_cython_bbox)

luyang-NWPU commented 6 years ago

I get a similar Error (Python2.7):

lu@lu-System-Product-Name:~/yolo2-pytorch-master$ python train.py Traceback (most recent call last): File "train.py", line 8, in from darknet import Darknet19 File "/home/lu/yolo2-pytorch-master/darknet.py", line 9, in from utils.cython_bbox import bbox_ious, bbox_intersections, bbox_overlaps, anchor_intersections ImportError: No module named cython_bbox

longcw commented 6 years ago

You should use absolute import (import from root) or from .utils.xxx import xxx in python3.

2017-12-19 8:58 GMT+08:00 Lu Yang notifications@github.com:

I get a similar Error (Python2.7):

lu@lu-System-Product-Name:~/yolo2-pytorch-master$ python train.py Traceback (most recent call last): File "train.py", line 8, in from darknet import Darknet19 File "/home/lu/yolo2-pytorch-master/darknet.py", line 9, in from utils.cython_bbox import bbox_ious, bbox_intersections, bbox_overlaps, anchor_intersections ImportError: No module named cython_bbox

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/longcw/yolo2-pytorch/issues/46#issuecomment-352606202, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6UgCw9UwQz9M_Y8ussSspetWu4PeUKks5tBwoigaJpZM4Q8w4H .

ghost commented 6 years ago

How to fix this?Please help

Traceback (most recent call last): File "/Users/williamardianto/Projects/cv/yolo2-pytorch/demo.py", line 7, in from darknet import Darknet19 File "/Users/williamardianto/Projects/cv/yolo2-pytorch/darknet.py", line 9, in from .utils.cython_bbox import bbox_ious, bbox_intersections, bbox_overlaps, anchor_intersections SystemError: Parent module '' not loaded, cannot perform relative import