我按照 google colab 上的 Medium 教程中给出的步骤进行操作,然后尝试克隆 git 存储库,但我在驱动器中的任何位置都看不到该存储库。
The following image is the code snippet I used which is exactly the same as that from the Medium tutorial:
![The code snippet I used which is exactly the same as that from the Medium tutorial](https://i.stack.imgur.com/M9e3z.png)
如何在 Google Colab 中添加 Google 云端硬盘的路径?
要在 google Colab 上安装 google 驱动器,只需使用以下命令:
from google.colab import drive
drive.mount('/content/drive')
它需要一个身份验证过程。做任何需要的事情(打开链接并复制密钥)
现在你已经安装了你的谷歌驱动器/content/drive/
您的 google Colab 机器中的目录。
要克隆 git 存储库,首先将当前目录设置为路径/content/drive/
,然后只需克隆 git 存储库。就像下面这样:
path_clone = "/content/drive/my_project"
%cd path_clone
!git clone <Git project URL address>
现在您将拥有克隆的 Git 项目my_projects
Google Drive 中的文件夹(也连接到您的 Google Colab 运行时机器)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)