Skip to content

Torchvision import leads to OpenCV imshow freeze #5940

Closed
@Flova

Description

@Flova

🐛 Describe the bug

Showing an image using OpenCV leads to the program getting stuck (100% CPU) without showing the image if torchvision is imported.

import numpy as np
import cv2

import torchvision
cv2.imshow("debug", np.zeros((128,128,3), dtype=np.uint8))   # Frezzes at this line if torchvision is imported
cv2.waitKey(1)

Expected result: The image is displayed and the program finishes.

Versions

PyTorch version: 1.11.0+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.13.0-37-generic-x86_64-with-glibc2.29
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2080 Ti
Nvidia driver version: 470.103.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.22.3
[pip3] pytorchvideo==0.1.5
[pip3] torch==1.11.0
[pip3] torch-summary==1.4.5
[pip3] torchvision==0.12.0
[conda] Could not collect

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions