google-colaboratory

How do I install a library permanently in Colab?

荒凉一梦 提交于 2019-11-30 05:45:43
问题 In Google Colaboratory, I can install a new library using !pip install package-name . But when I open the notebook again tomorrow, I need to re-install it every time. Is there a way to install a library permanently? No need to spend time installing every time to use? 回答1: Yes. You can install the library in Google Drive. Then add the path to sys.path . import os, sys from google.colab import drive drive.mount('/content/mnt') nb_path = '/content/notebooks' os.symlink('/content/mnt/My Drive

How to run eval.py job for tensorflow object detection models

点点圈 提交于 2019-11-30 04:02:50
I have trained an object detector using tensorflow's object detection API on Google Colab. After researching on the internet for most of the day, I haven't been able to find a tutorial about how to run an evaluation for my model, so I can get metrics like mAP. I figured out that I have to use the eval.py from the models/research/object_detection folder, but I'm not sure which parameters should I pass to the script. Shortly, what I've done so far is, generated the labels for the test and train images and stored them under the object_detection/images folder. I have also generated the train

Google Colab is very slow compared to my PC

*爱你&永不变心* 提交于 2019-11-30 03:59:56
I've recently started to use Google Colab, and wanted to train my first Convolutional NN. I imported the images from my Google Drive thanks to the answer I got here . Then I pasted my code to create the CNN into Colab and started the process. Here is the complete code: Part 1: Setting up Colab to import picture from my Drive (part 1 is copied from here as it worked as exptected for me Step 1: !apt-get install -y -qq software-properties-common python-software-properties module-init-tools !add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null !apt-get update -qq 2>&1 > /dev/null !apt

How to import data into google colab from google drive?

血红的双手。 提交于 2019-11-30 02:40:36
问题 I have some data files uploaded on my google drive. I want to import those files into google colab. The REST API method and PyDrive method show how to create a new file and upload it on drive and colab. Using that, I am unable to figure out how to read the data files already present on my drive in my python code. I am a total newbie to this. Can someone help me out? 回答1: (Update April 15 2018: The gspread is frequently being updated, so to ensure stable workflow I specify the version) For

Does Google Colab stay connected when I close my browser?

╄→гoц情女王★ 提交于 2019-11-30 01:19:15
This may be a dumb question, but does a job stop running on a Colab instance when I close my browser? If not, is there a way to keep it running (i.e until it's complete) In that same vein of thought, if I were to give someone edit access to my Colab notebook, would it be running on my instance of Colab with all my installed libraries or on theirs? The current cell will continue executing once you close your browser, but the outputs will not end up in the notebook in Drive. (If you were to reconnect before your VM were considered idle and deleted, any values you'd computed would still be

What's the hardware spec for Google Colaboratory?

雨燕双飞 提交于 2019-11-29 23:13:00
I load some (not so) big data into it. A compressed file at 9GB. It can't decompress because the disk space is not enough. What's the current hardware spec? What's the disk size? Bob Smith You can see the disk information using a command like !df -h . To see CPU specs, !cat /proc/cpuinfo . For memory, !cat /proc/meminfo . Here's an example notebook: https://colab.research.google.com/notebook#fileId=1_x67fw9y5aBW72a8aGePFLlkPvKLpnBl Here I run some test. https://colab.research.google.com/notebook#fileId=1dint4ly-7h8Trw0XRJ1uhC_VKe_wDJfY In short: n1-highmem-2 instance 2vCPU @ 2.2GHz 13GB RAM

Extract Google Drive zip from Google colab notebook

风流意气都作罢 提交于 2019-11-29 19:09:36
问题 I already have a zip of (2K images) dataset on a google drive. I have to use it in a ML training algorithm. Below Code extracts the content in a string format: from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive from google.colab import auth from oauth2client.client import GoogleCredentials import io import zipfile # Authenticate and create the PyDrive client. # This only needs to be done once per notebook. auth.authenticate_user() gauth = GoogleAuth() gauth.credentials

Meaning of “Power Level” on google colab

邮差的信 提交于 2019-11-29 15:57:45
问题 When I open a new notebook on Goole Colab I see a "POWER LEVEL" indicator with a battery symbol at the top. I can click it and choose three different power levels: low, medium and high. I don't remember ever seeing this before on Google Colab. I believe this is a new undocumented feature. Does anybody know what is the effect of changing power levels? 回答1: Power level is an April fools joke feature that adds sparks and combos to cell editing -- https://twitter.com/GoogleColab/status

How to import custom modules in google colab?

醉酒当歌 提交于 2019-11-29 11:01:53
I have a file named imutils.py that has just one definition namely abc() which returns the sum of 2 integers. Now I want to use this definition in a separate collab file but I am unable to. The method I used was to first upload the file imutils.py to drive and then importing it and using the definition. The error says module 'imutils' has no attribute 'abc' To upload I first used 2 methods : First I uploaded using the drive GUI and then I also tried the above using the code. Uploading in both cases was successful from google.colab import files files.upload() If your Python file is in Drive, it