从Google colab文档执行代码以创建Deepfakes图片动画时发生运行时错误

问题描述

enter image description here执行google colab文档中的代码以创建Deepfakes图片动画时遇到运行时错误

RuntimeError                              Traceback (most recent call last)

<ipython-input-5-dbd18151b569> in <module>()

  1 from demo import load_checkpoints
  2 generator,kp_detector = load_checkpoints(config_path='config/vox-256.yaml',

----> 3 checkpoint_path='/content/gdrive/My Drive/first-order-motion-model/vox-cpk.pth.tar')

10 frames

/usr/local/lib/python3.6/dist-packages/torch/cuda/__init__.py in _lazy_init()

188             raise AssertionError(

189                 "libcudart functions unavailable. It looks like you have a broken build?")

--> 190 torch._C._cuda_init()

191         # Some of the queued calls may reentrantly call _lazy_init();

192         # we need to just return without initializing in that case.

RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:47

解决方法

您可能正在Colab环境中运行,该环境仅具有TPU,而没有GPU,在这种情况下,您需要将XLA与PyTorch一起使用。在这种情况下,您可能会发现此笔记本和存储库非常有用:

https://colab.research.google.com/github/pytorch/xla/blob/master/contrib/colab/resnet18-training.ipynb

https://github.com/pytorch/xla

,

1。检查文件是否存在的路径 2.屏幕截图中没有安装驱动器,请尝试检查一次 3.如果前两个完成后仍然遇到问题,请检查给定的文件是否正确

希望这是helpfu:)