如何在 Google colab 中激活 GPU 计算?

use*_*493 1 python torch

我是火炬和蟒蛇的大人物,

我正在尝试使用 Google COlab 在网上找到的一些机器学习代码,但出现以下错误:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-d4b0db6cedae> in <module>()
    295                         input_dropout=input_dropout, hidden_dropout1=hidden_dropout1,
    296                         hidden_dropout2= hidden_dropout2, label_smoothing= label_smoothing)
--> 297 experiment.train_and_eval()
    298 
    299 

2 frames
/usr/local/lib/python3.6/dist-packages/torch/cuda/__init__.py in _lazy_init()
    195                 "Cannot re-initialize CUDA in forked subprocess. " + msg)
    196         _check_driver()
--> 197         torch._C._cuda_init()
    198         _cudart = _load_cudart()
    199         _cudart.cudaGetErrorName.restype = ctypes.c_char_p

RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:50
Run Code Online (Sandbox Code Playgroud)

我知道 cude 是用于 GPU 处理的吗?那么我该如何解决这个问题呢?我正在尝试使用此链接中的代码:

小智 10

您是否尝试过以下方法?

Go to Menu > Runtime > Change runtime.

Change hardware acceleration to GPU.

如何在 Google Colab GPU 中安装 CUDA