roytseng-tw / Detectron.pytorch

A pytorch implementation of Detectron. Both training from scratch and inferring directly from pretrained Detectron weights are available.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError using Pytorch 1.1.0

nQuant opened this issue · comments

Import Error using Pytorch 1.1.0

I encountered this error during a dataset conversion to COCO json format

----> 6 from lib.utils.boxes import xyxy_to_xywh
.
.
.
/content/Detectron.pytorch/lib/nn/parallel/scatter_gather.py in <module>()
      6 from ._functions import Scatter, Gather
      7 from torch._six import string_classes, int_classes
----> 8 from torch.utils.data.dataloader import numpy_type_map
      9 
     10 

ImportError: cannot import name 'numpy_type_map'

It seems that numpy_type_map has been moved to torch/utils/data/_utils/collate.py in pytorch 1.1.0

Maybe numpy_type_map should be redefined entirely instead of being imported.

Issue posted in the wrong fork.

I encountered the same question. How did you solve it?

I was using this fork that support Pytorch 1.1+ / torchvision 0.3.0+ with Python 3:
https://github.com/adityaarun1/Detectron.pytorch
The reported issue is now solved for this fork.

You may also consider to use Detectron2 for Pytorch 1.3+/ Python3.6+ instead.