Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoReader segmentation fault on long videos with timestamps #2259

Closed
bjuncek opened this issue May 25, 2020 · 4 comments
Closed

VideoReader segmentation fault on long videos with timestamps #2259

bjuncek opened this issue May 25, 2020 · 4 comments

Comments

@bjuncek
Copy link
Contributor

bjuncek commented May 25, 2020

🐛 Bug

VideoReader segmentation fault on long videos when using video_reader backend.
Notes:

  1. doesn't seem to happen with pyav backend
  2. reading in the entire video, without timestams seems to hang - not sure if this is the function of the video being to long or internal errors

To Reproduce

Steps to reproduce the behavior:

  1. select a video (in this case EPIC Kitchens videos
  2. set the tv.video_backend to video_reader
  3. read a video longer than (in my experience with 24 and 30fps videos) 15s
  4. observe segfault

Example of an ipython testing:

# works with pyav
In [1]: import torchvision as tv
In [2]: video_path = "/EPIC_KITCHENS_2018/062519/videos_24fps/train/P08/P08_21.MP4"
In [3]: video = tv.io.read_video(video_path, 0, 15.5, pts_unit="sec")
# success

# now set a video_reader background to try the same command?
In [4]: tv.set_video_backend("video_reader")
In [5]: video = tv.io.read_video(video_path, 0.5, 15.5, pts_unit="sec")
[F VideoReader.cpp:326] Check failed: numberWrittenBytes == expectedWrittenBytes (2245708800 vs. 18446744071660293120)
[1]    8565 abort (core dumped)  ipython

Expected behavior

Video is successfully read and returned as a tensor object

Environment

PyTorch version: 1.6.0.dev20200522
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: version 3.10.2

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration:
GPU 0: Quadro GP100
GPU 1: Quadro GP100

Nvidia driver version: 418.116.00
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.6.0.dev20200522
[pip] torchvision==0.7.0a0+3d65fc6
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.1.243 h6bb024c_0
[conda] mkl 2020.0 166
[conda] mkl-service 2.3.0 py37he904b0f_0
[conda] mkl_fft 1.0.15 py37ha843d7b_0
[conda] mkl_random 1.1.0 py37hd6b4f25_0
[conda] numpy 1.18.1 py37h4f9e942_0
[conda] numpy-base 1.18.1 py37hde5b4d6_1
[conda] pytorch 1.6.0.dev20200522 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch-nightly
[conda] torchvision 0.7.0a0+3d65fc6 pypi_0 pypi

  • How you installed PyTorch / torchvision (conda / source):
  • Build command you used (if compiling from source): python setup.py install
@fmassa
Copy link
Member

fmassa commented Jun 5, 2020

Does this happen with any long video or only with this video in particular?

@bjuncek
Copy link
Contributor Author

bjuncek commented Jun 8, 2020

So far I had it segfault on 3 different datasets, all of which inclueded loading longer video, although I can't find the culprit yet (It's not always the length, so I suspect it has to do something with memory it has to allocate for the decoding, but not sure).

@bjuncek
Copy link
Contributor Author

bjuncek commented Jun 8, 2020

Also, as I sidenote, this happened after I updated TV from 0.5a to 0.7. On 0.5 the same dataset seemed to work (but there is some length randomization, so that's not 100% reliable information.

@bjuncek
Copy link
Contributor Author

bjuncek commented Sep 8, 2020

Superseeded by the issue above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants