-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Cannot import video_reader #2163
Comments
Hi @surisdi To investigate this, could you provide the followings?
Also, torchvision in master branch is tested against nightly build of Torch. You may want to try that. |
Hi, Just to complement @mthrok questions, are you compiling torchvision in the same machine as the one you are using to run it? My impression is that you might have compiled using one system configuration, but are importing using another. Can you double-check? |
Hi, I installed Torch using the nightly build. I also re-installed all the libraries in the same machine. Now, the problem is slightly different, as it does not detect the "video_reader" package. The folder structure under In The result of
I cannot add a stack trace because there is not an error per se, it is simply that the library is not loaded. A minimal example code would be (definitely not very useful):
Thanks! |
@surisdi can you install torchvision using conda as well, instead of using pypi? It seems that you installed pytorch using conda while torchvision using pypi, which might have slightly different pytorch / torchvision nightlies. |
Hi @fmassa, I installed torchvision from source (following the instructions here), as suggested in this release. Does installing torchvision using conda install |
@surisdi hi, oh ok, I misread it from the Can you check if torch.ops.load_library('/path/to/video_reader.so') If Lines 174 to 175 in bd27e94
Maybe it might need to be adapted to other systems. |
Hi, the
However, when importing However, the torch.ops.load_library('.../site-packages/torchvision-0.7.0a0+bd27e94-py3.8-linux-x86_64.egg/torchvision/video_reader.so') is
Thanks, |
Hi, Thanks again for the message, I managed to reproduce the issue. Looking into it |
This works great, thanks! |
Awesome, thanks for trying this out! I'll merge the PR |
🐛 Bug
I cannot import
video_reader
(io._HAS_VIDEO_OPT
isFalse
).When
torchvision.io
is imported, andtorchvision/io/_video_opt.py
is executed, there is aOSError
when the libraryvideo_reader
is imported. The library is found properly.Specifically, the
OSError
is caused in this line:torch.ops.load_library(ext_specs.origin)
, and it is:[...]/site-packages/torchvision-0.7.0a0+f9ef235-py3.7-linux-x86_64.egg/torchvision/video_reader.so: undefined symbol: _ZTIN6ffmpeg6StreamE
I installed torchvision from source, and the versions of the libraries are the following:
ffmpeg: 4.2.2
torchvision: 0.7.0a0+f9ef235
torch: 1.5.0
What do you think the problem could be? Thanks!
The text was updated successfully, but these errors were encountered: