【问题标题】:Running Python codes with cuda support in Google Colab在 Google Colab 中运行支持 cuda 的 Python 代码
【发布时间】:2022-02-06 19:22:08
【问题描述】:

我的 Macbook pro 不支持 GPU。我在 Google colab 中上传了一个代码目录以利用 Cuda 支持。但是,我看到代码无法访问当前目录中文件夹中的其他文件。请指教。

enter image description here

enter image description here

【问题讨论】:

    标签: python pytorch google-colaboratory pytorch-geometric


    【解决方案1】:

    将运行时更改为 GPU 后,您需要重新上传文件或重新连接到 Google Drive。

    【讨论】:

      【解决方案2】:

      首先,您需要使用以下脚本安装驱动器。

      从 google.colab 导入驱动器

      drive.mount('你的目录地址')

      【讨论】:

      • 谢谢。我知道这很有效,但即使在您运行代码时,让 Google Colab 完全访问您的驱动器是否安全
      • 如果你想使用google colab,你必须接受它。根据我的经验,我从来没有遇到过任何与安全相关的问题,但这值得一提。
      猜你喜欢
      • 2018-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-20
      • 2021-05-29
      • 2020-12-02
      • 1970-01-01
      相关资源
      最近更新 更多