google-colaboratory

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

ぐ巨炮叔叔 提交于 2019-12-05 03:35:39
%%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 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/Colab\ Notebooks/object_detection_demo-master/test.py Additional Info: If you jusst want to run !python test

Write out file with google colab

假装没事ソ 提交于 2019-12-05 02:23:17
Was there a way to write out files with google colab? For example, if I use import requests r = requests.get(url) Where will those files be stored? Can they be found? And similarly, can I get the file I outputted via say tensorflow save function saver=tf.Saver(....) ... path = saver.save(sess, "./my_model.ckpt") Thanks! In your first example, the data is still in r.content . So you also need to save them first with open('data.dat', 'wb').write(r.content) Then you can download them with files.download from google.colab import files files.download('data.dat') Downloading your model is the same:

Buffered data was truncated after reaching the output size limit

巧了我就是萌 提交于 2019-12-04 23:16:44
问题 When I use Colaboratory to run my NIN model, it occurs an error in the output of training process which tells "Buffered data was truncated after reaching the output size limit." in the 61th epoch. I have no idea about this crash.Is my code still running ? How can I solve this problem? Here is some information about the output of my training process: Epoch 57/200 391/391 [==============================] - 53s 135ms/step - loss: 0.8365 - acc: 0.7784 - val_loss: 0.9250 - val_acc: 0.7625 Epoch 58

LaTeX equations do not render in google Colaboratory when using IPython.display.Latex

可紊 提交于 2019-12-04 21:32:53
问题 In a regular jupyter notebook, running, for example, the following: from IPython.display import display, Math, Latex display(Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx')) produces an equation rendered in LaTeX (via Mathjax). Even though LaTeX works fine in markdown cells, LaTeX equations produced as above do not seem to render in Google Colaboratory. The same happens to the output of functions for example from qutip, which would normally render in latex (for example, qutip

How to save a Tensorflow Checkpoint file from Google Colaboratory in when using TPU mode?

喜夏-厌秋 提交于 2019-12-04 15:29:15
When I use saver = tf.train.Saver() and save_path = saver.save(session, "checkpointsFolder/checkpoint.ckpt") I get a UnimplementedError (see above for traceback): File system scheme '[local]' not implemented error Here is the full error --------------------------------------------------------------------------- UnimplementedError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1333 try: -> 1334 return fn(*args) 1335 except errors.OpError as e: /usr/local/lib/python3.6/dist-packages/tensorflow/python

How to downgrade tensorflow version in colab?

↘锁芯ラ 提交于 2019-12-04 11:22:14
I am using pip3 install tensorflow==1.8.0 , but it doesn't have GPU support. So I am using pip3 install tensorflow-gpu==1.8.0 , but it still raises an exception libcudart.so.VERSION No such file. Should I use colab to install tensorflow from source? After pip3 list : tensorboard 1.10.0 tensorflow 1.10.0 tensorflow-hub 0.1.1 miguelmorin You can downgrade Tensorflow to a previous version without GPU support on Google Colab. I ran: !pip install tensorflow==1.12.0 import tensorflow as tf print(tf.__version__) which initially returned 2.0.0-dev20190130 but when I returned to it after a few hours, I

Google-colaboratory: No backend with GPU available

て烟熏妆下的殇ゞ 提交于 2019-12-04 10:16:40
问题 Here it is described how to use gpu with google-colaboratory: Simply select "GPU" in the Accelerator drop-down in Notebook Settings (either through the Edit menu or the command palette at cmd/ctrl-shift-P). However, when I select gpu in Notebook Settings I get a popup saying: Failed to assign a backend No backend with GPU available. Would you like to use a runtime with no accelerator? When I run: import tensorflow as tf device_name = tf.test.gpu_device_name() if device_name != '/device:GPU:0'

How can we use Selenium Webdriver in colab.research.google.com?

这一生的挚爱 提交于 2019-12-04 09:41:18
问题 I want to use Selenium Webdriver of Chrome in colab.research.google.com for fast processing. I was able to install Selenium using !pip install selenium but the webdriver of chrome needs a path to webdriverChrome.exe. How am I suppose to use it? P.S.- colab.research.google.com is an online platform which provides GPU for fast computational problems related to deep learning. Please refrain from solutions such as webdriver.Chrome(path). 回答1: You can do it by installing the chromium webdriver and

Exporting Data from google colab to local machine

丶灬走出姿态 提交于 2019-12-04 09:20:41
问题 How to export data frames which are created in google colab to your local machine? I have cleaned a data set on google colab. Now I want to export the data frame to my local machine. df.to_csv is saving file to the virtual machine and not my local machine. 回答1: Try this from google.colab import files files.download("data.csv") Update(Sep 2018): now it's even easier open the left pane select 'Files' tab click 'Refresh' right click the file, then download 回答2: Try this: First you can save the

Can't read a file in google colaboratory

感情迁移 提交于 2019-12-04 08:36:48
问题 Can't read a file in google colaboratory . I have .ipynb file and .csv files in the same directory but when I try to run: train = pd.read_csv("train.csv") I get: FileNotFoundError: File b'train.csv' does not exist 回答1: I hope you have run this code before opening your train file. Part I # Install a Drive FUSE wrapper. # https://github.com/astrada/google-drive-ocamlfuse !apt-get install -y -qq software-properties-common python-software-properties module-init-tools !add-apt-repository -y ppa