简体   繁体   English

谷歌合作实验室中的谷歌驱动器地址

[英]google drive address in google colaboratory

I am new to google colaboratory.我是谷歌合作实验室的新手。

In My Drive there are my required files.在我的云端硬盘中有我需要的文件。 the address of train.py file is: train.py 文件的地址是:

gdrive/My Drive/Colab Notebooks/Project_Folder/DELTA-master/DELTA-master/train.py . gdrive/My Drive/Colab Notebooks/Project_Folder/DELTA-master/DELTA-master/train.py

I use this address in a cell as follow to run train.py:我在一个单元格中使用这个地址来运行train.py:

. python gdrive/My Drive/Colab Notebooks/Project_Folder/DELTA-master/DELTA-master/train.py

but I get this error:但我收到此错误:

FileNotFoundError: [Errno 2] No such file or directory: 'gdrive/My Drive/Colab Notebooks/Project_Folder/DELTA-master/DELTA-master/train.py' FileNotFoundError:[Errno 2] 没有这样的文件或目录:'gdrive/My Drive/Colab Notebooks/Project_Folder/DELTA-master/DELTA-master/train.py'

Can anyone help me?!谁能帮我?!

from google.colab import drive 
drive.mount('/content/drive')

Use this to generate an authentication code and make the drive accessible.使用它来生成验证码并使驱动器可访问。

Then in colab, under files in the left side tab, see if you can locate the file.然后在 colab 中,在左侧选项卡中的 files 下,查看是否可以找到该文件。 Then right click on the file and select copy path.然后右击文件,select复制路径。

Or you can use或者你可以使用

/content/drive/My\ Drive/ <path to your file in gdrive>

Don't forget to put "\" whereever the foldername has space in it不要忘记在文件夹名称中有空格的地方放置“\”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Colaboratory中加载Google云端硬盘中的数据 - Trouble loading data from Google Drive in Colaboratory 合作-记住Google Drive Auth(Python) - Colaboratory - Remember Google Drive Auth (Python) Google Drive 和 Colaboratory 虚拟机未正确同步 - Google Drive and Colaboratory Virtual Machine are not syncing properly 从Google云端硬盘将Keras模型导入Colaboratory - Importing Keras models into Colaboratory from Google Drive 从合作实验室访问Google云端硬盘中的文件夹 - Accessing a folder in Google Drive from Colaboratory 使用google-colaboratory上传到google驱动器的文件的路径是什么? - What is the path of the file uploaded to google drive using google-colaboratory? Google Colaboratory 中的 Python - 如何在 Google Drive 中创建、写入和读取文件 - Python in Google Colaboratory - How to create, write and read files in google drive 如何使用Colaboratory(google)从Google驱动器读取数据 - how to read data from google drive using Colaboratory (google) 如何将 csv 文件(并使用它)从谷歌驱动器上传到谷歌合作实验室 - How to upload csv file (and use it) from google drive into google colaboratory 导入存储在google drive中的google colaboratory中的zip文件 - importing zip file in google Colaboratory stored in google drive
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM