Because of a very large image dataset, datagen.flow_from_directory is extremely slow. Is there a way to copy the "data" folder on my Google drive to the local session in Google Colab? Kind of like uploading a file from my PC to the session, but from Drive.
Copy files from a mounted Google Drive to a local Google Colab session
Asked Answered
Found it. After mounting the drive, it's as simple as
!cp -r /content/drive/MyDrive/data /content/data
The first path is the "data" folder on my Google Drive, and the second one is the destination in my current runtime
i hope that this notebook can help you. link to notebook
- FOLDER_PATH - path of folder you want to copy
- DESTINATION_PATH - destination of the folder where you want to save the copy
!cp -r '/gdrive/My Drive/FOLDER_PATH' '/gdrive/My Drive/DESTINATION_PATH'
© 2022 - 2024 — McMap. All rights reserved.