ShuangXieIrene / ssds.pytorch

Repository for Single Shot MultiBox Detector and its variants, implemented with pytorch, python3.
MIT License
571 stars 166 forks source link

ImportError: No module named _mask #22

Closed isalirezag closed 6 years ago

isalirezag commented 6 years ago

I run this code python train.py --cfg=./experiments/cfgs/ssd_vgg16_train_voc.yml and this is what i get:

python train.py --cfg=./experiments/cfgs/ssd_vgg16_train_voc.yml
Traceback (most recent call last):
  File "train.py", line 20, in <module>
    from lib.ssds_train import train_model
  File "/home/alireza/Desktop/ssd/B/lib/ssds_train.py", line 23, in <module>
    from lib.dataset.dataset_factory import load_data
  File "/home/alireza/Desktop/ssd/B/lib/dataset/dataset_factory.py", line 2, in <module>
    from lib.dataset import coco
  File "/home/alireza/Desktop/ssd/B/lib/dataset/coco.py", line 13, in <module>
    from lib.utils.pycocotools.coco import COCO
  File "/home/alireza/Desktop/ssd/B/lib/utils/pycocotools/coco.py", line 55, in <module>
    from . import mask as maskUtils
  File "/home/alireza/Desktop/ssd/B/lib/utils/pycocotools/mask.py", line 3, in <module>
    import lib.utils.pycocotools._mask as _mask
ImportError: No module named _mask

Any idea why?? Also What python version are using? Plut where should i put the dataset (eg coco vgg)

isalirezag commented 6 years ago

I was using python 2 and that was the issue...

ramonqu7 commented 6 years ago

What was your solution to this?

isalirezag commented 6 years ago

switch to python 3

vaishnavm217 commented 6 years ago

I am getting the same error in python3 on my gpu server, although it worked in my pc

seongkyun commented 5 years ago

I have solved this problem without any upgrading python version. My python version is Python 3.5. The problem is just /home/username/ssds.pytorch/lib/utils/pycocotools/_mask.cpython-36m-x86_64-linux-gnu.so file. Just install COCOAPI following https://github.com/cocodataset/cocoapi instruction and copy and paste _mask.cpython-**YOUR_PYTHON_VERSION**m-x86_64-linux-gnu.so file to /home/username/ssds.pytorch/lib/utils/pycocotools

then the error will be dissappeared.

stalagmite7 commented 5 years ago

where is this file? I cant find it after install cocoapi.

seongkyun commented 5 years ago

@stalagmite7 You can find that folder at your_dir/cocoapi/PythonAPI/pycocotools