google-colaboratory

OSError: Input/Output Error - Google Colab

こ雲淡風輕ζ 提交于 2019-12-10 11:44:10
问题 Using h5py.File(path,'r') or (Keras) model.load_weights(path) on .h5 files yields the below error. I've trained models on Colab for months, never had this problem. The same files open just fine on my computer when downloaded from Drive. At first one notebook failed to open .h5 files - all others followed soon after. What's the error, and how to troubleshoot? Inability to save & load models renders Colab unusable - help is appreciated. UPDATE : What started as inability to open h5 files

Unable to import module in Google Colab after installing

一笑奈何 提交于 2019-12-10 09:47:34
问题 I was trying to clone and install the Google Unrestricted adversarial examples repository following the instructions provided here. But I am unable to import the any of the modules. First I cloned the repository and changed to that directory. !git clone https://github.com/google/unrestricted-adversarial-examples.git cd unrestricted-adversarial-examples Then I used the pip install command. !pip -e install bird-or-bicycle The installation completed without any error. However, when I try to

How to display plotly outputs in google collaboratory notebooks?

隐身守侯 提交于 2019-12-10 09:33:42
问题 I searched whole day how to display the outputs of plotly plots in google colaboratory jupyter notebooks. There is a stackoverflow question and also official tutorial from google colaboratory but both of them did not work for me. official link: https://colab.research.google.com/notebooks/charts.ipynb#scrollTo=hFCg8XrdO4xj stackoverflow question: Plotly notebook mode with google colaboratory https://colab.research.google.com/drive/14oudHx5e5r7hm1QcbZ24FVHXgVPD0k8f#scrollTo=8RCjUVpi2_xd The

Google colab file download failed to fetch error

橙三吉。 提交于 2019-12-10 09:32:27
问题 I used google colab to make a dictionary, dump it into a json file and download the file into my laptop by this code: from google.colab import files import json dict = {'apple': 'fruit', 'mango': 'fruit', 'carrot': 'vegetable', 'brocoli': 'vegetable', 'cat': 'animal'} with open('sampleDictionary.json', 'w') as f: json.dump(dict, f) files.download('sampleDictionary.json') f.close() When I try to run this code, it gives this error: MessageError Traceback (most recent call last) <ipython-input

How to run a Python script in a '.py' file from a Google Colab notebook?

自古美人都是妖i 提交于 2019-12-09 15:34:31
问题 %%javascript IPython.OutputArea.prototype._should_scroll = function(lines) { return false; } %run rl_base.py I run this giving error saying rl_base.py file not found. I have uploaded the same to gdrive in colab and from the same folder I am running my .ipynb file, containing the above code 回答1: If you have the test.py file in the corresponding folder in drive as in the below attached image, then the command which you use to run the test.py file is as mentioned below, !python gdrive/My\ Drive

How to upload and save large data to Google Colaboratory from local drive?

放肆的年华 提交于 2019-12-09 12:07:42
问题 I have downloaded large image training data as zip from this Kaggle link https://www.kaggle.com/c/yelp-restaurant-photo-classification/data How do I efficiently achieve the following? Create a project folder in Google Colaboratory Upload zip file to project folder unzip the files Thanks EDIT: I tried the below code but its crashing for my large zip file. Is there a better/efficient way to do this where I can just specify the location of the file in local drive? from google.colab import files

How to render OpenAI gym in google Colab?

给你一囗甜甜゛ 提交于 2019-12-09 10:58:58
问题 I'm trying to use OpenAI gym in google colab. As the Notebook is running on a remote server I can not render gym's environment. I found some solution for Jupyter notebook, however, these solutions do not work with colab as I don't have access to the remote server. I wonder if someone knows a workaround for this that works with google Colab? 回答1: Korakot's answer is not correct. You can indeed render OpenAi Gym in colaboratory, albiet kind of slowly using none other than matplotlib. Heres how:

Saving pip installs in google colab

笑着哭i 提交于 2019-12-08 10:25:02
问题 Is there a way to save packages in Google Collab to my Google Drive? This is so I won't have to re-download and re-install packages every time I want to use them. 回答1: To save your the installed configuration to your Google Drive: from google.colab import drive drive.mount('/content/gdrive') pip freeze --local > /content/gdrive/My\ Drive/colab_installed.txt To restore: from google.colab import drive drive.mount('/content/gdrive') pip install --upgrade --force-reinstall `cat/content/gdrive/My\

Installing tf-nightly-gpu-2.0-preview on Google Colab

陌路散爱 提交于 2019-12-08 09:10:28
问题 I would like to test the new TensorFlow 2.0 preview on Colab with GPU support but, after installing TensorFlow using !pip install tf-nightly-gpu-2.0-preview on a cell, when I import the package I get the error: ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory which points to some misalignment with the pre-installed CUDA version on the platform. 回答1: The solution is to re-install CUDA 10.0 on Colab by the following instructions: !wget https://developer

ImportError: No module named object_detection.builders in colab google

假如想象 提交于 2019-12-08 08:09:45
问题 I have this error when i run %cd !git clone --quiet https://github.com/tensorflow/models.git !apt-get install -qq protobuf-compiler python-tk !pip install -q Cython contextlib2 pillow lxml matplotlib PyDrive !pip install -q pycocotools %cd ~/models/research !protoc object_detection/protos/*.proto --python_out=. import os os.environ['PYTHONPATH'] += ':/content/models/research/:/content/models/research/slim/' !python object_detection/builders/model_builder_test.py I got this /root/models