gpt4 book ai didi

python - 如何仅加载 google colab 上的特定文件夹?

转载 作者:太空宇宙 更新时间:2023-11-03 11:58:41 29 4
gpt4 key购买 nike

我试图从我的驱动器加载一个文件夹,但在加载时出现错误

ValueError                                Traceback (most recent call last)
<ipython-input-3-a977da366961> in <module>()
1 from google.colab import drive
----> 2 drive.mount('content/gdrive/My Drive/kaggle')

/usr/local/lib/python3.6/dist-packages/google/colab/drive.py in mount(mountpoint, force_remount, timeout_ms)
69
70 if ' ' in mountpoint:
---> 71 raise ValueError('Mountpoint must not contain a space.')
72
73 mountpoint = _os.path.expanduser(mountpoint)

ValueError: Mountpoint must not contain a space.

如何摆脱这个错误。这是我尝试过的:

from google.colab import drive
drive.mount('content/gdrive/My Drive/kaggle')

最佳答案

这对我有用:

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

根据提示进行鉴权,然后

# remember to escape white spaces
%cd /gdrive/My\ Drive/name_of_your_folder_in_drive

关于python - 如何仅加载 google colab 上的特定文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55384621/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com