我有一个文件夹,里面有很多文件夹--上传到google colab的最好方法是什么?我尝试访问这个链接:How to upload folders to Google Colab?,但它没有找到我的文件夹: !unzip -uq "/content/drive/My Drive/Data/Output/" -d "/content/drive/My Drive/Data/Output/" 并得到错误: unzip: cannot find or open /content/drive/Data/Output/, /content/drive/Data/Out
我试着用google colab.Images从google驱动器读取图片在文件夹Anomalytection/图像中
我试图使用以下命令链接该文件夹
import os
from google.colab import drive
drive.mount('/content/drive')
os.chdir("drive/My Drive/AnomalyDetection/images")
os.listdir()
但我收到了错误信息
FileNotFoundError: [Errno 2] No such file or directory: 'd
所以,在Google Play Services中
final DriveFolder rootFolder = Drive.DriveApi.getRootFolder(mGoogleApiClient);
若要获取根文件夹,则可以使用“父”功能。
在REST中,要列出根子类,必须将'root' in parents添加到查询参数中。
但是Google Api Java客户机中没有搜索查询功能,还是我还没有找到它呢?
我不能使用Drive.Children.list(String),因为我必须先找出根文件夹id。
我用下面的代码将我的Google Drive连接到Google Colab:
# Load the Drive helper and mount
from google.colab import drive
# This will prompt for authorization.
drive.mount('/content/drive')
现在,当我想要读取驱动器中包含图像的一系列文件夹时,它的运行速度比我的pc慢得多!
我注意到,如果我第二次运行代码,在前一次运行中已经读取的文件夹加载速度会更快。
你对这个问题有什么建议吗?谢谢。