Google collaborative

2020-05-09 17:36发布

问题:

I am working on a CNN program on google colab.
I am trying to run, ImageDataGenerator.flow_from_directory.

I want to include the dataset directory in this function. I have made a google drive folder "App" and in that folder I have made "dataset" Folder in which i included my dataset for training and test.

The problem is that I am not able to include this drive folder in colab for this command.

Anyone have experience of running ImageDataGenerator.flow_from_directory on colab? How to add dataset from google drive?

回答1:

According to the API, this should allow you to upload files to the colaboratory venv:

from google.colab import files
uploaded = files.upload()   
for fn in uploaded.keys():
  print('User uploaded file "{name}" with length {length} bytes'.format(
      name=fn, length=len(uploaded[fn])))