Open xiaosu-zhu opened 2 weeks ago
Same problem here
I have made a several test and found the core problem is from torch cuda. You could try several snippets below:
import torch
from decord import VideoReader
vr = VideoReader(video_path) a = torch.tensor([3], device='cuda')
Segmentation fault (core dumped)
2. ❌
```python
import torch
from decord import VideoReader
a = torch.tensor([3], device='cuda')
vr = VideoReader(video_path)
---
Segmentation fault (core dumped)
import torch
a = torch.tensor([3], device='cuda')
from decord import VideoReader
vr = VideoReader(video_path)
NORMAL
I found when creating a cuda tensor DIRECTLY AFTER torch import and then import the decord, all things will be fine.
If you import decord ahead and create any cuda tensor, a Segmentation fault will immediately throw out.
EDIT: The root cause of Segmentation fault is from torch, not cv2, please see the correction below.
I have installed opencv-python-headless and decord together. The version info is listed below.
I try to import two libs in a python script:
No matter which order I import two libs, both of them lead to
Segmentation fault (core dumped)
crash, without any other logs.