AruniRC / detectron-self-train

A PyTorch Detectron codebase for domain adaptation of object detectors.
MIT License
118 stars 21 forks source link

ImportError: cannot import name numpy_type_map #15

Open Shuntw6096 opened 3 years ago

Shuntw6096 commented 3 years ago

Hi, Automatic adaptation of object detectors to new domains using self-training is a nice work, but when I run gypsum/scripts/demo/hp_cons_demo.sh use bdd_HP-cons_model_step29999.pth.pth and occur

Traceback (most recent call last):
  File "tools/infer_demo.py", line 35, in <module>
    import nn as mynn
  File "/content/detectron-self-train/lib/nn/__init__.py", line 2, in <module>
    from .parallel import DataParallel
  File "/content/detectron-self-train/lib/nn/parallel/__init__.py", line 3, in <module>
    from .data_parallel import DataParallel, data_parallel
  File "/content/detectron-self-train/lib/nn/parallel/data_parallel.py", line 4, in <module>
    from .scatter_gather import scatter_kwargs, gather
  File "/content/detectron-self-train/lib/nn/parallel/scatter_gather.py", line 8, in <module>
    from torch.utils.data.dataloader import numpy_type_map
ImportError: cannot import name numpy_type_map

System information

and it does not seem to support torch >= 1.1.0 and I also find some issues.

detectron2 supports pytorch 1.3.0 and above, and cuda 10.1 only supports pytorch 1.4 and above. Is it possible to move to detectron2?

Thanks

AruniRC commented 3 years ago

Hi,

thanks for your interest in this work. This repo is no longer being actively maintained and porting this to detectron2 is not immediately a priority for us. Sorry for the inconvenience. Can you try using the older versions of pytorch and numpy in a conda environment?

Shuntw6096 commented 3 years ago

Hi, I find a another version of Detectron also implemented in pytorch but version of pytorch is 1.1.0 , and it support CUDA10.0. I use its lib to replace original one, and run gypsum/scripts/demo/hp_cons_demo.sh but will modify yaml file, and it works. Thanks