我想在Colab上做一个深度学习系统。 我的数据存储在笔记本电脑上的本地文件夹中,但我不知道如何访问它。
当我这样做时,它给了我一个错误:
import os
output = [dI for dI in os.listdir(main_folder) if os.path.isdir(os.path.join(main_folder,dI))]
print (output)
[Errno 2] No such file or directory:
main_folder
是本地路径:C:/.../.../
最佳答案
访问本地文件的一个选项是使用 Colab 和本地安装的 Jupyter。执行此操作的说明如下:
http://research.google.com/colaboratory/local-runtimes.html
另一个选项是安装 Google Drive在本地计算机上,将文件放在那里,然后使用以下代码片段将您的云端硬盘文件挂载到 Colab 上:
from google.colab import drive
drive.mount('/content/gdrive')
关于python - 使用 Colab 访问本地文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52540775/