我正在尝试将Google驱动器中的一些数据加载到我的colab笔记本中,但是我得到的是一个空列表。
码:
from google.colab import drive
drive.mount('/content/drive')
import glob
import os
test_path = '/content/gdrive/My Drive/ML/data/cifar-100/test'
#path = os.path.join(test_path, 'class1', '*.jpg')
#path = os.path.join(test_path, 'class1', '*g')
path = os.path.join(test_path, 'class1', '*.*')
files = glob.glob(path)
len(files)
输出:0
数据
谁能告诉我为什么它没有加载,一切似乎都很好
您已将驱动器安装到,/content/drive
但在测试路径中却/content/gdrive
无法使用。您需要使用/content/drive/My drive/...
test_path = '/content/drive/My Drive/ML/data/cifar-100/test'
有关更多信息,请参见此处。
希望能帮助到你!
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句