facebookresearch / facebookresearch/detectron2

ImportError: libcudart.so.10.2: cannot open shared object file: No such file or directory

Open
#4,934 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
34.7k
Forks
7.9k
PR merge metrics
No merged PRs in 30d

Description

I tried to run the CPU version following the installation but I have the error from the title.
`ImportError: libcudart.so.10.2: cannot open shared object file: No such file or directory`

## Environment:

1. `python -m pip install detectron2==0.6 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.10/index.html`

2. I also installed the required torch version (with cpu)
```
pip install torch==1.10.0+cpu torchvision==0.11.0+cpu torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
```

I was able to import detectron2 but importing other modules from inside of the package looks like need to have installed CUDA.
I saw previous issues resolved by renaming the repository and using the installed package. However, this is not an issue here because I don't even have the git repo cloned on my directory. I'm using it directly from the package.
![image](https://user-images.githubusercontent.com/51296911/235762621-e6257dde-fbbc-4a7d-97a8-c7337a11f518.png)

## Instructions To Reproduce the Issue:
When I try to do
`from detectron2 import model_zoo`
```
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[14], line 1
----> 1 from detectron2 import model_zoo

File ~/miniconda3/envs/py39/lib/python3.9/site-packages/detectron2/model_zoo/__init__.py:8
1 # Copyright (c) Facebook, Inc. and its affiliates.
2 """
3 Model Zoo API for Detectron2: a collection of functions to create common model architectures
4 listed in `MODEL_ZOO.md `_,
5 and optionally load their pre-trained weights.
6 """
----> 8 from .model_zoo import get, get_config_file, get_checkpoint_url, get_config
10 __all__ = ["get_checkpoint_url", "get", "get_config_file", "get_config"]

File ~/miniconda3/envs/py39/lib/python3.9/site-packages/detectron2/model_zoo/model_zoo.py:9
7 from detectron2.checkpoint import DetectionCheckpointer
8 from detectron2.config import CfgNode, LazyConfig, get_cfg, instantiate
----> 9 from detectron2.modeling import build_model
12 class _ModelZooUrls(object):
13 """
14 Mapping from names to officially released Detectron2 pre-trained models.
15 """

File ~/miniconda3/envs/py39/lib/python3.9/site-packages/detectron2/modeling/__init__.py:2
1 # Copyright (c) Facebook, Inc. and its affiliates.
----> 2 from detectron2.layers import ShapeSpec
4 from .anchor_generator import build_anchor_generator, ANCHOR_GENERATOR_REGISTRY
5 from .backbone import (
6 BACKBONE_REGISTRY,
7 FPN,
(...)
13 make_stage,
14 )

File ~/miniconda3/envs/py39/lib/python3.9/site-packages/detectron2/layers/__init__.py:3
1 # Copyright (c) Facebook, Inc. and its affiliates.
2 from .batch_norm import FrozenBatchNorm2d, get_norm, NaiveSyncBatchNorm, CycleBatchNormList
----> 3 from .deform_conv import DeformConv, ModulatedDeformConv
4 from .mask_ops import paste_masks_in_image
5 from .nms import batched_nms, batched_nms_rotated, nms, nms_rotated

File ~/miniconda3/envs/py39/lib/python3.9/site-packages/detectron2/layers/deform_conv.py:11
8 from torch.nn.modules.utils import _pair
9 from torchvision.ops import deform_conv2d
---> 11 from detectron2 import _C
13 from .wrappers import _NewEmptyTensorOp
16 class _DeformConv(Function):

ImportError: libcudart.so.10.2: cannot open shared object file: No such file or directory
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the import with the listed CPU installations, starting at detectron2/model_zoo/__init__.py and following the traceback through detectron2/modeling, detectron2/layers/deform_conv.py, and the detectron2._C import. Compare the CPU wheel behavior while importing model_zoo; done means the documented CPU installation imports these modules without requiring the missing CUDA runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.