question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No such operator video_reader::read_video_from_memory when using torchvision backend

See original GitHub issue

🐛 Bugs / Unexpected behaviors

I get a RuntimeError: No such operator video_reader::read_video_from_memory when trying to decode a video using the torchvision backend.

Instructions To Reproduce the Issue:

Run the following code:

from pytorchvideo.data.encoded_video import EncodedVideo

path_video = "/path/to/video.mp4"
video_pyav = EncodedVideo.from_path(path_video, decoder='pyav')  # Runs without any problem
video_torchvision = EncodedVideo.from_path(path_video, decoder='torchvision')  # Throws error

Logs:

Failed to decode video of name <video_name>.mp4. No such operator video_reader::read_video_from_memory
Traceback (most recent call last):
  File "/path/to/conda/env/lib/python3.7/site-packages/pytorchvideo/data/encoded_video_torchvision.py", line 206, in _torch_vision_decode_video
    raise e
  File "/path/to/conda/env/lib/python3.7/site-packages/pytorchvideo/data/encoded_video_torchvision.py", line 180, in _torch_vision_decode_video
    tv_result = torch.ops.video_reader.read_video_from_memory(
  File "/path/to/conda/env/lib/python3.7/site-packages/torch/_ops.py", line 60, in __getattr__
    op = torch._C._jit_get_operation(qualified_op_name)
RuntimeError: No such operator video_reader::read_video_from_memory
python-BaseException

The current version of the libraries is: pytorchvideo -> 0.1.2 torch -> 1.9.0+cu111 torchvision -> 0.10.0+cu111

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
surisdicommented, Jul 1, 2021

Hi, after reinstalling pytorch and updating CUDA drivers, the error can’t be reproduced anymore.

1reaction
chenjoyacommented, Oct 24, 2021

@surisdi @kalyanvasudev Hi, I also encounter the similar problem. Could you help me? By reinstalling pytorch via conda:

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

The problem still exists:

video_pyav = EncodedVideo.from_path(path_video, decoder='pyav')  # Okay!
video_torchvision = EncodedVideo.from_path(path_video, decoder='torchvision')  # segmentation fault (core dumped)

BTW, is torchvision backend much faster than pyav? Then I may still use pyav backend.

Attach my env:

image

Thank you for your attention!

By updating pyav:

conda install av -c conda-forge

My problem is solved. Thank you for your pytorchvideo repo. Excellent work. I love it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No such operator torchvision::nms - pytorch - Stack Overflow
As I met lot of hurdles to install torch and torchvison ,I'm not reluctant to reinstall the enviroment.Running 'conda list' the version of ......
Read more >
Torchvision main documentation - PyTorch
The video_reader package includes a native C++ implementation on top of FFMPEG libraries, and a python API of TorchScript custom operator. It generally...
Read more >
Jetson AGX Orin ,pytorch, torchvision
"otImplementedError: Could not run 'torchvision::nms' with arguments from the 'CUDA' backend. This could be because the operator doesn't ...
Read more >
torch.onnx — PyTorch master documentation
Once these are installed, you can use the backend for ONNX Runtime: ... For example, do not use numpy operators on numpy tensors:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found