💻
Cheatsheets
  • Most Useful Command Line Tools: 50 Cool Tools to Improve Your Workflow, Boost Productivity, and More
  • 7_tips_to_reverse_engineer_javascript
  • Configuring a Repl
  • How to create your command-line program (CLI) with NodeJS and Commander.js | by Duc N. | JavaScript
  • replit Node.JS 24/7 Project Hoster
  • cheatsheets
  • Alacritty, Tmux, and Vim
  • amethyst
  • Android
  • Installing Arch Linux
  • Arch Linux
  • aria2
  • bin
  • bspwm
  • Chocolately Notes
  • command_line_pipes
  • CSS Grid
  • curl
  • The curl guide to HTTP requests
  • Docker
  • Easymotion
  • Emmet
  • Favorite figlet fonts
  • FFMPEG
  • figlet
  • File Serve
  • File Transfer
  • fish shell
  • Front End Dev Links
  • How to use Git.io to shorten GitHub URLs and create vanity URLs
  • Git
  • Downloading a Tarball from GitHub
  • Make Infinite Gmail Addresses For One Inbox
  • How To Use GPG on the Command Line
  • guide_to_fish_completions
  • Homebrew
  • How to clean Arch Linux
  • HTML5 Boilerplate
  • Install
  • All the keyboard shortcuts you’ll ever need for Safari on iPad
  • iosevka
  • iPhone
  • ish (iOS)
  • Javascript Notes
  • jq
  • Jupyter Notebooks
  • Lettering
  • lf-wiki
  • lf
  • Command Line
  • Adding a swapfile after a clean installation without swap partition
  • mac_bluetooth_issues
  • Mac Terminal
  • maim
  • markdown-sample
  • Markdown Notes
  • Images in README.md Markdown Files
  • Organizing information with tables
  • md_cheatsheet
  • NiftyWindows Help
  • nix
  • Justin Restivo - A Portable Text Editor: Nix <3 Neovim
  • NPM
  • neovim configuration
  • Pastery
  • Powershell
  • Table of Basic PowerShell Commands | Scripting Blog
  • Powershell Modules
  • Puppeteer
  • Python
  • rclone-colab
  • replit
  • Hi there, I'm Raju Ghorai - a.k.a. [coderj001]
  • Scriptable
  • Servor
  • Replacing Postlight’s Mercury scraping service with your self-hosted copy
  • Shell Scripts
  • skhd
  • Spicetify
  • SSH
  • SurfingKeys
  • tar
  • Terminal Web Browser Docker
  • Text Generators
  • tmux shortcuts & cheatsheet
  • unicode
  • VIM
  • VIM Diff
  • vi Complete Key Binding List
  • 8 Essential Vim Editor Navigation Fundamentals
  • Vim Shortcut Keys
  • Vite
  • VNC
  • web-servers
  • Web Server
  • Windows Command Line
  • Writeguard
  • WSL Cheatsheet
  • youtube-dl
  • zsh Plugins
  • zspotify
Powered by GitBook
On this page
  • Why You Should Try Rclone with Google Drive and Colab
  • Wouldn’t it be nice if you never lost your trained ML models on the Google Colab? Rclone to the rescue.
  • Step 1. Install Rclone.
  • Step 2. Configure Rclone.
  • Step 2.1. Make a new remote
  • Step 2.2. Name it “remote”
  • Step 2.3. Enter “15” for the Google Drive
  • Step 2.4. Press Enter for default on client_id
  • Step 2.5. Press Enter for default on client_secret
  • Step 2.6. Enter “1” for Full access all files on your Google Drive.
  • Step 2.7. Press Enter for default on root_folder_id.
  • Step 2.8. Press Enter for default on service_account_file.
  • Step 2.9. Enter “n” for default on advanced config.
  • Step 2.10. Enter “n” for non-default on Remote config.
  • Step 2.11. Enter “n” for default on Shared Drive.
  • Step 2.12. Enter “y” for default on remote settings.
  • Step 2.13. Enter “q” for Quit config.
  • Step 3. Export with Rclone.
  • Summary
  • References
  • More from Towards Data Science
  • More From Medium
  • Automatic Video Editing using Python
  • Big Data will First Slow, Not Accelerate, Discovery
  • the least among high-income developed nations at 4.3%
  • What is true impact?
  • Visualization and Multiple imputation
  • Exploring Greater Sydney suburbs
  • A Brief insight on Data Pre-processing and Visualization for Machine Learning Model
  • Stack Index 📇

Was this helpful?

rclone-colab

PreviousPythonNextreplit

Last updated 3 years ago

Was this helpful?

·

Why You Should Try Rclone with Google Drive and Colab

Wouldn’t it be nice if you never lost your trained ML models on the Google Colab? Rclone to the rescue.

Image by author.

Do you ever start training a machine learning model on the Google Colab and the runtime disconnects before you can save your results? It use to happen to me and I would get frustrated. I would leave my model training to come back a few hours later and find it finished without saving!

Image by author.

So what can you do about this? Use Rclone¹, Google Drive², and Google Colab³ together with the following 3 major steps:

1) Install Rclone.

2) Configure Rclone.

3) Export with Rclone.

Step 1. Install Rclone.

Do this in the very first cell of your Google Colab Jupyter Notebook.

<span id="3c3b" class="hr mn lk gu mo b dn mp mq s mr">! curl https://rclone.org/install.sh | sudo bash</span>

Step 2. Configure Rclone.

Configure the newly installed Rclone.

<span id="ff6d" class="hr mn lk gu mo b dn mp mq s mr">!rclone config</span>

Step 2.1. Make a new remote

Step 2.2. Name it “remote”

Step 2.3. Enter “15” for the Google Drive

Step 2.4. Press Enter for default on client_id

Step 2.5. Press Enter for default on client_secret

Step 2.6. Enter “1” for Full access all files on your Google Drive.

Step 2.7. Press Enter for default on root_folder_id.

Step 2.8. Press Enter for default on service_account_file.

Step 2.9. Enter “n” for default on advanced config.

Step 2.10. Enter “n” for non-default on Remote config.

Go to the link it generates for you.

Copy the code from your Google Drive Sign in for Rclone access.

Paste it where it tells you to Enter verification code

Step 2.11. Enter “n” for default on Shared Drive.

Step 2.12. Enter “y” for default on remote settings.

Step 2.13. Enter “q” for Quit config.

Step 3. Export with Rclone.

Add an export after your model finishes training.

Copy your current “/content/” directory in the Google Colab to wherever you want on your Google Drive through the Rclone remote path we just established.

<span id="ebce" class="hr mn lk gu mo b dn mp mq s mr">!rclone copy "/content/"  remote:"/YOUR_PATH_TO_GDRIVE_DESIRED_LOCATION/"</span>

Summary

So after following those 3 major steps outlined above, you should be able to back-up whatever models you are training with Google Colab (assuming they finish).

You can see for that example, my Google Drive stored the trained models as such under content:

Image by author.

I hope you found this article helpful! Thank you for reading and hit the like if so. Follow me on here for more machine learning based content coming soon!

References

45

45

45

Your home for data science. A Medium publication sharing concepts, ideas and codes.

More From Medium

Here is an example that implements theses steps from start to finish.

You can find more examples in this I made for various TensorFlow machine learning problem notebooks.

You can also follow me on LinkedIn:

Rclone.[ ]

Google Drive. [ ]

Google Colab. [ ]

TensorFlow. Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis,Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Rafal Jozefowicz, Yangqing Jia,Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Mike Schuster,Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Jonathon Shlens,Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker,Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas,Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke,Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. Software available from.

Writing about Data Science, CV, DL, ML, AI, Python

in

in

in

in

Steven Smiley
Jun 17·4 min read
Jupyter Notebook
Github repository
https://www.linkedin.com/in/stevensmiley1989/
https://rclone.org/
https://g.co/kgs/qu7aAY
https://colab.research.google.com/
tensorflow.org
Steven Smiley
https://www.linkedin.com/in/stevensmiley1989/
Follow
Machine Learning
Google Colab
Rclone
Deep Learning
Artificial Intelligence
More from Towards Data Science
Follow
Read more from Towards Data Science
Automatic Video Editing using Python
Dmytro Nikolaiev (Dimid)
Towards Data Science
Big Data will First Slow, Not Accelerate, Discovery
Eric Luellen
the least among high-income developed nations at 4.3%
Allsportslivenow
What is true impact?
Arun Ramanujapuram
logistimo
Visualization and Multiple imputation
Rabi Kumar Singh
Exploring Greater Sydney suburbs
Tariq Munir
Towards Data Science
A Brief insight on Data Pre-processing and Visualization for Machine Learning Model
Suhana Anjum
Stack Index 📇
Vaishnavi V
featurepreneur
Get started
Open in app
Homepage
Sign in
Get started
Homepage
Follow
602K Followers
Editors' Picks
Features
Deep Dives
Grow
Contribute
About
Get started
Open in app
Homepage
Steven Smiley
Towards Data Science