在Google Colab中如何修复”.cuda()”显示错误

huangapple go评论49阅读模式
英文:

How to fix ".cuda()" showing error in google colab

问题

"model = model.cuda()" 这部分代码是将模型转移到GPU上运行。

英文:

enter image description here

Here, "model = model.cuda()"

答案1

得分: 0

你需要选择 GPU。

从 Runtime -> 更改运行时类型,选择 GPU 作为加速器。

英文:

You need to choose gpu.

from Runtime -> change runtime type and select GPU as accelerator

答案2

得分: 0

当您希望您的笔记本能够使用GPU时,您需要编辑设置。

转到编辑 >> 笔记本设置 >> 硬件加速器 >> GPU >> 保存 >> 重新启动运行时。

英文:

When you want your notebook to be able to use GPU, you need to edit the settings.

go to Edit >> Notebook settings >> Hardware accelerator >> GPU >> Save >> restart the runtime

在Google Colab中如何修复”.cuda()”显示错误

在Google Colab中如何修复”.cuda()”显示错误

huangapple
  • 本文由 发表于 2023年5月11日 05:10:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76222579.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定