使用Colab访问本地文件夹 [英] Access to local folder with Colab
问题描述
我想在Colab上构建一个深度学习系统.我的数据存储在笔记本电脑上的本地文件夹中,但我不知道如何访问.
执行此操作时,它会给我一个错误:
import os输出= [如果os.path.isdir(os.path.join(main_folder,dI)),则os.listdir(main_folder)中dI的dI]]打印(输出)
[Errno 2]没有这样的文件或目录:
main_folder
是本地路径: C:/.../.../
感谢帮助
访问本地文件的一种方法是在本地安装的Jupyter中使用Colab.这样做的说明在这里:
I want to make a deep learning system on Colab. My data are stored in a local folder on my laptop but I don't know how to acceed it.
When I do this, it gives me an error :
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
is a local path : C:/.../.../
Thanks for help
One option to access local files is to use Colab with a local install of Jupyter. Instructions to do that are here:
http://research.google.com/colaboratory/local-runtimes.html
Another option is to install Google Drive on your local machine, put the files there, and then mount your Drive files on Colab using the following snippet:
from google.colab import drive
drive.mount('/content/gdrive')
After that, your Drive files will appear in the built-in file browser. For example,
这篇关于使用Colab访问本地文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!