Detectron2 libraries not installing (Colab Tutorial also not working)
See original GitHub issueInstructions To Reproduce the 🐛 Bug:
Code:
# Some basic setup:
!pip install pyyaml==5.1
import torch
TORCH_VERSION = ".".join(torch.__version__.split(".")[:2])
CUDA_VERSION = torch.__version__.split("+")[-1]
#print("torch: ", TORCH_VERSION, "; cuda: ", CUDA_VERSION)
!pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/$CUDA_VERSION/torch$TORCH_VERSION/index.html
# Setup detectron2 logger
import detectron2
from detectron2.utils.logger import setup_logger
setup_logger()
# import some common libraries
import numpy as np
import os, json, cv2, random
from google.colab.patches import cv2_imshow
# import some common detectron2 utilities
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.data import MetadataCatalog, DatasetCatalog>
Logs:
ImportError Traceback (most recent call last) <ipython-input-3-9283645e3740> in <module>() 11 12 # import some common detectron2 utilities —> 13 from detectron2 import model_zoo 14 from detectron2.engine import DefaultPredictor 15 from detectron2.config import get_cfg
4 frames /usr/local/lib/python3.7/dist-packages/detectron2/layers/deform_conv.py in <module>() 8 from torch.nn.modules.utils import _pair 9 —> 10 from detectron2 import _C 11 12 from .wrappers import _NewEmptyTensorOp
ImportError: /usr/local/lib/python3.7/dist-packages/detectron2/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceISt7complexIdEEEPKNS_6detail12TypeMetaDataEv
NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the “Open Examples” button below.>
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top GitHub Comments
Me too I have problem installing D2 in Colab from yesterday, I guess they changed Pytorch version in Colab. I solved by reinstalling the compatible version of Pytorch:
The colab tutorial now uses a different pytorch version and works correctly