![]() Make sure you trust the authors of any notebook before executing it. This allows you to execute code on your local hardware. Say I have a module called naive_sharding.py in my my_modules directory.Colab lets you connect to a local runtime. I have direct OS access to Google Drive contents - natively on Chrome, and via ocamlfuse on Ubuntu - and can make use of them starting with the same Google Drive filesystem access trick in the above point. This way I can use the file both inside Colab and outside. Let's say they are simple a collection of helper modules I have gotten used to using myself data loader functions, data cleaning functions, and the like.Īny files like this I store in a Dropbox folder with the same name which I sync with the Google Drive version. I don't want to store them on GitHub, and they aren't clean files I want to otherwise have to make clean and share with others. So, what if you have custom Python libraries or modules you want to import into Colab projects?įor example, I have a folder I called 'my_modules' in my Colab directory I store common. Use custom libraries and modules stored in Google Drive Titanic_train = pd.read_csv('/content/gdrive/My Drive/Colab Notebooks/datasets/titanic/train_clean.csv')ģ. You call plot_model to create a PNG file, but since Colab virtual machines don't give you permanency in file storage, you want to download the image. A use case: you have created a Keras model and want to visualize the model. This is another simple one, but important enough to mention. I know, not really on topic, but still useful. That's it now you open Colab in its very own window, like in the post header image, from its very own icon. This is OS-dependent, but involves having the Colab "app" installed in your Chrome browser, and selecting both "Open as window" and "Create shortcuts." from the app context menu, after which you need to find the shortcut and use it to open the app in its own window. Sullying that up any further with both the Colab management interface and a bunch of notebooks won't help, so run Colab as its own standalone app. If you're like me, your tab situation is sub-optimal. ![]() OK, this isn't really a Colab tip, but first get Colab out of the browser. Note that some of these are plain vanilla Jupyter tricks, so don't me. I stress that this is what I am using for my learning, no mission-critical projects, and I am primarily using Colab as I can switch between my various machines seamlessly, while still having access to GPUs for training (and even TPUs). This post is a second entry in the short-but-hopefully-useful Google Colab environment tips series, and includes 3 more things I've learned while managing my own Colab coding environment while learning. It turned out to be a good decision I have been regularly using Colab for the past few months for all of my learning-related coding. However, after dipping back into the books and needing a stable notebook environment which I could access and share seamlessly between my notebook, workstation, and Chromebook, I decided to give Colab another look. Well, like every novelty, Colab's excitement wore off a bit after the initial euphoria. After originally being quite excited about it, I wrote a short post with a few tips for new users, which covered taking advantage of the free GPU runtime, installing additional third-party Python libraries, and uploading and using data files to your Colab environment. Google's Colab was greeted with all sorts of hype when it was first publicly released in early 2018.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |