No such operator video_reader::probe_video_from_memory,slowfast代码复现bug记录
slowfast github链接:https://github.com/facebookresearch/SlowFast
bug1
使用kinetics数据集,复现X3D预训练模型进行测试,当yaml配置文件中DECODING_BACKEND设置为torchvision的时候,出现了报错:
Failed to decode by torchvision with exception: No such operator video_reader::probe_video_from_memory
GitHub上关于这个问题的讨论链接:https://github.com/facebookresearch/SlowFast/issues/181
报错代码块:在decoder.py的函数def torchvision_decode中
# Convert the bytes to a tensor.
video_tensor = torch.from_numpy(np.frombuffer(video_handle, dtype=np.uint8))
decode_all_video = True
video_start_pts, video_end_pts = 0, -1
# The video_meta is empty, fetch the meta data from the raw video.
if len(video_meta) == 0:
# Tracking the meta info for selective decoding in the future.
meta = io._probe_video_from_memory(video_tensor)```
翻遍了Google,没找到解决方案,原论文使用的torch1.3,但是detectron2的最低限制torch就是torch1.6版本,再低就不能编译了…
博主尝试了python3.6,pytho3.7,python3.8,torch1.3+torchvision0.4.2,torch1.4,torch1.6,torch1.7,torch1.8并与之对应的torchvision版本(官网conda安装方式),还是不行…
官网没有torch1.3的conda和pip安装,博主使用的source code安装。
发现类似问题最多的就是RuntimeError: No such operator torchvision::nms,解决办法也是说torch版本问题,但是博主测试过了,python3.6+torch1.6+torchvision0.7+cuda10.2的nms是可以work的。
最后,实在没有办法
No such operator video_reader::probe_video_from_memory这个问题暂时解决不了,那就换一种解码方式吧,yaml配置文件中,设置DECODING_BACKEND: pyav ,亲测,能够work。
如果有大神能够解决,欢迎留言,谢谢!