question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c1012CUDATensorIdEv

See original GitHub issue

If you do not know the root cause of the problem / bug, and wish someone to help you, please post according to this template:

Instructions To Reproduce the Issue:

  1. what changes you made (git diff) or what code you wrote
<put diff or code here>
  1. what exact command you run:

python demo/demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --video-input test.mp4 --output ./output.mp4

  1. what you observed (including the full logs):
<put logs here>

OpenCV: FFMPEG: tag 0x34363278/‘x264’ is not supported with codec id 27 and format ‘mp4 / MP4 (MPEG-4 Part 14)’ OpenCV: FFMPEG: fallback to use tag 0x31637661/‘avc1’ Could not find encoder for codec id 27: Encoder not found 0%| | 0/5616 [00:00<?, ?it/s]Traceback (most recent call last): File “demo/demo.py”, line 137, in <module> for vis_frame in tqdm.tqdm(demo.run_on_video(video), total=num_frames): File “/home/ubuntu/anaconda3/envs/detectron/lib/python3.7/site-packages/tqdm/std.py”, line 1104, in iter for obj in iterable: File “/home/ubuntu/detectron2/demo/predictor.py”, line 129, in run_on_video yield process_predictions(frame, self.predictor(frame)) File “/home/ubuntu/detectron2/detectron2/engine/defaults.py”, line 189, in call predictions = self.model([inputs])[0] File “/home/ubuntu/anaconda3/envs/detectron/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 541, in call result = self.forward(*input, **kwargs) File “/home/ubuntu/detectron2/detectron2/modeling/meta_arch/rcnn.py”, line 109, in forward return self.inference(batched_inputs) File “/home/ubuntu/detectron2/detectron2/modeling/meta_arch/rcnn.py”, line 166, in inference proposals, _ = self.proposal_generator(images, features, None) File “/home/ubuntu/anaconda3/envs/detectron/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 541, in call result = self.forward(*input, **kwargs) File “/home/ubuntu/detectron2/detectron2/modeling/proposal_generator/rpn.py”, line 179, in forward self.training, File “/home/ubuntu/detectron2/detectron2/modeling/proposal_generator/rpn_outputs.py”, line 137, in find_top_rpn_proposals keep = batched_nms(boxes.tensor, scores_per_img, lvl, nms_thresh) File “/home/ubuntu/detectron2/detectron2/layers/nms.py”, line 17, in batched_nms return box_ops.batched_nms(boxes, scores, idxs, iou_threshold) File “/home/ubuntu/anaconda3/envs/detectron/lib/python3.7/site-packages/torchvision/ops/boxes.py”, line 72, in batched_nms keep = nms(boxes_for_nms, scores, iou_threshold) File “/home/ubuntu/anaconda3/envs/detectron/lib/python3.7/site-packages/torchvision/ops/boxes.py”, line 32, in nms _C = _lazy_import() File “/home/ubuntu/anaconda3/envs/detectron/lib/python3.7/site-packages/torchvision/extension.py”, line 12, in _lazy_import from torchvision import _C as C ImportError: /home/ubuntu/anaconda3/envs/detectron/lib/python3.7/site-packages/torchvision/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c1012CUDATensorIdEv 0%| | 0/5616 [00:00<?, ?it/s]

  1. please also simplify the steps as much as possible so they do not require additional resources to run, such as a private dataset.

Expected behavior:

If there are no obvious error in “what you observed” provided above, please tell us the expected behavior.

If you expect the model to converge / work better, note that we do not give suggestions on how to train a new model. Only in one of the two conditions we will help with it: (1) You’re unable to reproduce the results in detectron2 model zoo. (2) It indicates a detectron2 bug.

Environment:

Please paste the output of python -m detectron2.utils.collect_env.

sys.platform linux Python 3.7.5 (default, Oct 25 2019, 15:51:11) [GCC 7.3.0] Numpy 1.17.4 Detectron2 Compiler GCC 5.5 Detectron2 CUDA Compiler 9.1 DETECTRON2_ENV_MODULE <not set> PyTorch 1.3.1 PyTorch Debug Build False torchvision unknown CUDA available True GPU 0 GeForce GTX 1080 CUDA_HOME /usr/lib/cuda NVCC Cuda compilation tools, release 9.1, V9.1.85 Pillow 6.2.1 cv2 4.1.2


PyTorch built with:

  • GCC 7.3
  • Intel® Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel® 64 architecture applications
  • Intel® MKL-DNN v0.20.5 (Git Hash 0125f28c61c1f822fd48570b4c1066f96fcb9b2e)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • NNPACK is enabled
  • CUDA Runtime 10.0
  • NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  • CuDNN 7.6.3
  • Magma 2.5.1
  • Build settings: BLAS=MKL, BUILD_NAMEDTENSOR=OFF, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Wno-stringop-overflow, DISABLE_NUMA=1, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=True, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF,

If detectron2 hasn’t been successfully installed, use python detectron2/utils/collect_env.py.

If your issue looks like an installation issue / environment issue, please first try to solve it yourself with the instructions in https://github.com/facebookresearch/detectron2/blob/master/INSTALL.md#common-installation-issues

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
hasnainkothawalacommented, Nov 30, 2020

Hey guys, I came across this same issue. The reason I think this error comes up is,

  1. You install torch, torchvision and then use a CUDA to compile and install detectron2.
  2. You try to work on something else and somehow you torch and torchvision were downgraded to a different version.
  3. Now, when you try to run the detectron2 installed in step1. It throws this error because the compiler version ( using which it was initially installed) has changed while you downgraded the torch and torchvision in step 2.

Solution (which worked for me). Upgrade your torch and torchvision, and recompile Detectron2.

** pip install torch --upgrade ** pip install torchvision --upgrade

0reactions
rahatzamancsecommented, Oct 13, 2020

The solution is in https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues:

Undefined CUDA symbols; Cannot open libcudart.so

If the solution does not work, please use the issue template to report problems.

As I do not have any nvidea card (trying to run on cpu), so I should not have any libcudart.so

Read more comments on GitHub >

github_iconTop Results From Across the Web

C/C++ so undefined symbol - Stack Overflow
I am trying to create a dynamic library written using pure "C" (libSetupConfig.so) and another one using "C++" (libUserAnalysis.so) such ...
Read more >
Undefined Symbols (Linker and Libraries Guide)
A symbol remains undefined when a symbol reference in a relocatable object is never matched to a symbol definition. $ cat main.c extern...
Read more >
Xcode 12b3 Undefined symbol: __swi… - Apple Developer
I've tried linking the WebKit.framework and import WebKit in the mentioned files, but the error remains. This is a mixed Obj-C / Swift...
Read more >
Undefined symbol arm_nn_softmax_common_s8
I want to use the tensorflow Lite Micro in the c++ project of armDS. There is an error when I check the library...
Read more >
Compile db2Ingest API C program fails with error "Undefined ...
xlc -I/home/db2inst1/sqllib/include -L/home/db2inst1/sqllib/lib -ldb2e -ldb2osse -ldb2gcf -ldb2 -g -o db2api db2api.c ld: 0711-317 ERROR: Undefined symbol: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found