facebookresearch / SlowFast

PySlowFast: video understanding codebase from FAIR for reproducing state-of-the-art video models.
Apache License 2.0
6.38k stars 1.18k forks source link

OSError: Video 0 cannot be opened #699

Open Liqironga opened 3 months ago

Liqironga commented 3 months ago

When I tried to test the demo, it failed to run. log: /home/qiro/miniconda3/lib/python3.10/site-packages/torchvision/transforms/_functional_video.py:6: UserWarning: The 'torchvision.transforms._functional_video' module is deprecated since 0.12 and will be removed in the future. Please use the 'torchvision.transforms.functional' module instead. warnings.warn( /home/qiro/miniconda3/lib/python3.10/site-packages/torchvision/transforms/_transforms_video.py:22: UserWarning: The 'torchvision.transforms._transforms_video' module is deprecated since 0.12 and will be removed in the future. Please use the 'torchvision.transforms' module instead. warnings.warn( config files: ['demo/AVA/SLOWFAST_32x2_R101_50_50.yaml'] [ WARN:0@0.931] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video0): can't open camera by index [ERROR:0@0.931] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range Traceback (most recent call last): File "/home/qiro/slowfast/SlowFast/tools/run_net.py", line 55, in main() File "/home/qiro/slowfast/SlowFast/tools/run_net.py", line 51, in main demo(cfg) File "/home/qiro/slowfast/SlowFast/tools/demo_net.py", line 112, in demo frame_provider = VideoManager(cfg) File "/home/qiro/slowfast/SlowFast/slowfast/visualization/demo_loader.py", line 49, in init raise IOError("Video {} cannot be opened".format(self.source)) OSError: Video 0 cannot be opened

wxy0059 commented 3 months ago

I have the same problem,dont know how to solve..

Liqironga commented 3 months ago

I rebuilt the environment and haven't encountered this issue again. Please make sure to check if the paths in the YAML file are correct.