google-colaboratory

Saving or downloading plotly iplot images on Google Colaboratory

余生长醉 提交于 2019-12-24 10:48:39
问题 I have been attempting to download a plot created using plotly on google colaboratory. So far this is what I have attempted: I have tried changing files.download('foo.svg') to files.download('foo') and I still get no results. I navigated to the files on Google colab and nothing shows there import numpy as np import pandas as pd from plotly.offline import iplot import plotly.graph_objs as go from google.colab import files def enable_plotly_in_cell(): import IPython from plotly.offline import

Direct Google Colab Links

爷,独闯天下 提交于 2019-12-24 10:27:54
问题 How to get the direct link to a Google Colab file instead of its drive link? Want the format: https://colab.research.google.com/notebooks/welcome.ipynb Pressing share button gives this URL which opens drive on clicking. https://colab.research.google.com/ drive /1IZw9t1F47pjAL3LZU2Mrkl-sBiG3rT44 回答1: The /drive/... link is the direct link to a notebook stored in Drive. (Similarly, notebooks stored in github have a /github/... prefix. Notebooks like /notebooks/welcome.ipynb are part of the

Running TensorFlow tests in Google Colab

孤街醉人 提交于 2019-12-24 06:03:42
问题 I want to run tests on Google Colab to ensure reproducibility but I get a system error at the end, which I do not on my local machine. I set up TensorFlow in Google Colab with !pip install tensorflow==1.12.0 import tensorflow as tf print(tf.__version__) which, after some lines of installation, prints: 1.12.0 I then want to run a simple test: import tensorflow as tf class Tests(tf.test.TestCase): def test_gpu(self): self.assertEqual(False, tf.test.is_gpu_available()) tf.test.main() The test

Running TensorFlow tests in Google Colab

非 Y 不嫁゛ 提交于 2019-12-24 06:02:13
问题 I want to run tests on Google Colab to ensure reproducibility but I get a system error at the end, which I do not on my local machine. I set up TensorFlow in Google Colab with !pip install tensorflow==1.12.0 import tensorflow as tf print(tf.__version__) which, after some lines of installation, prints: 1.12.0 I then want to run a simple test: import tensorflow as tf class Tests(tf.test.TestCase): def test_gpu(self): self.assertEqual(False, tf.test.is_gpu_available()) tf.test.main() The test

How to install vizdoom using Google Colab?

拟墨画扇 提交于 2019-12-24 03:20:15
问题 I am following this tutorial using Google Colab. But I have problems with running from vizdoom import * that should enable the Doom environment. I tried to execute !pip install vizdoom , but it failed. Collecting vizdoom Using cached https://files.pythonhosted.org/packages/45/15/8053139ab32054bed0b1bf46473f54c5a8d85e5c1d25b23410bc5de913c1/vizdoom-1.1.4.tar.gz Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from vizdoom) (1.14.3) Building wheels for collected

Flipping and rotating a tensor (within a U-net) in Tensorflow 2.0 exhaust the memory. How to do it properly?

眉间皱痕 提交于 2019-12-23 05:15:24
问题 I have a simple Dense-U-net implemented in Tensorflow 2.0 (and tf.keras) to do semantic segmentation. At the end of each dense block, I want to randomly rotate and/or flip the tensors (just for experimentation). The initial size of the image is 256x256. At the moment I want to perform flipping/rotating, the tensors have always C=5 channels (this is, shape=[?,256,256,5] (NHWC) in the beginning, reducing H & W as pooling is performed, but C is always 5 and batch size is N=8). Thus, the tensors

Google Colab ngrok convert to python

吃可爱长大的小学妹 提交于 2019-12-23 04:48:29
问题 I have a Google Colab notebook with following commands !wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip !unzip ngrok-stable-linux-amd64.zip LOG_DIR = './log' get_ipython().system_raw( 'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &' .format(LOG_DIR) ) These commands run very well without any error in Google Colab . But when I run the same in python get error. Python demo.py import sys, json import requests from IPython import get_ipython import requests LOG_DIR =

AttributeError: module 'tensorflow' has no attribute 'gfile'

笑着哭i 提交于 2019-12-23 03:33:15
问题 I trained a simple mnist model with tensorflow 2.0 on Google Colab and saved it in the .json format. Click here to check out the Colab Notebook where I've written the code. Then on running the command !simple_tensorflow_serving --model_base_path="/" --model_platform="tensorflow" It is showing the error AttributeError: module 'tensorflow' has no attribute 'gfile' simple_tensorflow_serving helps in easily deploying trained tensorflow model into production. Versions I'm using: (1) TensorFlow - 2

How can I keep the gpu running for more than 12 hours in google colaboratory?

妖精的绣舞 提交于 2019-12-23 01:38:09
问题 I am trying to train a model on google colaboratoy but the problem is that the GPU gets disconnected after 12 hours and hence I am not able to train my model beyond a certain point. Is there a way to keep GPU connected for longer times? 来源: https://stackoverflow.com/questions/49469697/how-can-i-keep-the-gpu-running-for-more-than-12-hours-in-google-colaboratory

What's the latest conda version compatible with Google Colab

ε祈祈猫儿з 提交于 2019-12-22 13:03:01
问题 I need to use conda to install some library to use with Colab. It seems that we cannot use the latest Anaconda because its Python 3.7 isn't compatable. So what's latest compatible version for both Anaconda and Miniconda ? And how to install them? 回答1: The latest compatible versions are Anaconda 5.2.0 Miniconda 4.5.4 Here's how to install them. I use an example installing faiss from pytorch channel. !wget -c https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh !chmod +x Anaconda3