如何将流引导视频完成 (FGVC) 用于个人文件?对于那些想从 Google Colab 平台免费使用 FGVC 的人来说,各种官方来源没有指定操作(https://colab.research.google.com/drive/1pb6FjWdwq_q445rG2NP0dubw7LKNUkqc?usp=sharing)。作为测试,我将视频上传到 Google Drive(与我运行 Google Colab 脚本的帐户相同),该视频分为多个帧,位于名为“demo1.zip”的 .zip 文件夹中。然后我运行序列中的第一个脚本,称为“准备环境”,我通过公共链接激活视频共享,并复制了第二个脚本中的链接(紧跟第一个单词“wget -quiet”)和第一个条目“rm”我输入了“demo1.zip”,与我的视频文件的名称有关。在阅读了第二个脚本的运行按钮上方的说明后,我继续这样做:“我们展示了一个 15 帧序列的演示。要处理您自己的数据,只需上传序列并指定路径。” 也运行第二个脚本,这是成功的,我的视频文件已加载。然后我转到第四个(也是最后一个)脚本,该脚本包括通过 AI 处理内容以获得具有扩大视野(FOV => 更大纵横比)的最终产品。运行几秒钟后,该过程以错误结束:
File "video_completion.py", line 613, in <module>
main (args)
File "video_completion.py", line 576, in main
video_completion_sphere (args)
File "video_completion.py", line 383, in video_completion_sphere
RAFT_model = initialize_RAFT (args)
File "video_completion.py", line 78, in initialize_RAFT
model.load_state_dict (torch.load (args.model))
File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 594, in load
return _load (opened_zipfile, map_location, pickle_module, ** pickle_load_args)
File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 853, in _load
result = unpickler.load ()
File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 845, in persistent_load
load_tensor (data_type, size, key, _maybe_decode_ascii (location))
File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 834, in load_tensor
loaded_storages [key] = restore_location (storage, location)
File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 175, in default_restore_location
result = fn (storage, location)
File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 151, in _cuda_deserialize
device = validate_cuda_device (location)
File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 135, in validate_cuda_device
raise RuntimeError ('Attempting to deserialize object on a CUDA'
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available () is False. If you are running on a CPU-only machine, please use torch.load with map_location = torch.device ('cpu') to map your storages to the CPU.
执行有什么问题?有没有办法修复并允许使用 Google Colab 完成该过程?让我知道!