Segmentation Fault When Using Decord and TorchVision Together
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
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
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.