decord icon indicating copy to clipboard operation
decord copied to clipboard

Segmentation Fault When Using Decord and TorchVision Together

Open johannukrow opened this issue 1 year ago • 2 comments

First of all, I'd like to express my admiration for this project! It’s been incredibly helpful in my work, and I truly appreciate all the effort that has gone into building and maintaining it. However, I’ve encountered an issue that seems to indicate an incompatibility between decord and torchvision. Here’s a minimal reproducible example:

from decord import VideoReader
from torchvision import models

models.segmentation.fcn_resnet50().cuda()

Error Encountered:

Segmentation fault (core dumped)

Environment Details:

torch: 2.3.1
torchmetrics: 1.6.0
torchvision: 0.18.1
decord: 0.6.0
Python: 3.11.10

johannukrow avatar Dec 05 '24 14:12 johannukrow

maybe try swiching the import order. I found sometimes it work. like this, instead of importing decord first.

from torchvision import models
from decord import VideoReader

cryonox avatar Dec 15 '24 04:12 cryonox

Replicated the same error just using simple codes here

import os
import decord
import torch

device = torch.device('cuda')
mean_tensor = torch.tensor([[[[104.]], [[117.]], [[123.]]]], device=device)
print(mean_tensor)

Running the script got sgementation fault (core dumped) error. Just comment import decord or switch import torch before import decord, the error will be gone.

ziyannchen avatar Dec 30 '24 04:12 ziyannchen