【问题标题】:Datasets in the Google ColabGoogle Colab 中的数据集
【发布时间】:2021-03-21 22:58:59
【问题描述】:

我想用图像加载我自己的数据集,以测试我的 CNN 算法。我有两个文件夹,一个用于培训,另一个用于验证。我已将该文件夹加载到 Google 云端硬盘中。我想问一下如何将Drive中的文件夹下载到Colab中?或者也许还有其他更好的方法可以做到这一点?我期待尽快收到你的消息。祝你好运!

【问题讨论】:

标签: machine-learning deep-learning conv-neural-network google-colaboratory


【解决方案1】:

由于您已经在 drive 中拥有该文件夹,请转到 google colab 并运行以下命令:

#Mounting your Google Drive in the runtime's virtual machine
from google.colab import drive
drive.mount('/content/drive/')

在运行上述代码时,您将找到一个 URL,您可以从中获取授权代码。将代码粘贴到提供的空白处,然后单击进入 如果您能够访问 Google Drive,则您的 google drive 文件应全部位于:

然后您可以使用复制路径并移动到目录:

%cd /content/drive/MyDrive/foldername

【讨论】:

    猜你喜欢
    • 2018-08-24
    • 2020-09-23
    • 1970-01-01
    • 2020-11-07
    • 1970-01-01
    • 2021-06-07
    • 2023-03-18
    • 2021-01-12
    • 2019-05-31
    相关资源
    最近更新 更多