google-colaboratory

“UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80” while loading pickle file using pydrive on google colaboratory

早过忘川 提交于 2019-12-02 14:05:10
问题 I am new to using google colaboratory (colab) and pydrive along with it. I am trying to load data in 'CAS_num_strings' which was written in a pickle file in a specific directory on my google drive using colab as: pickle.dump(CAS_num_strings,open('CAS_num_strings.p', 'wb')) dump_meta = {'title': 'CAS.pkl', 'parents': [{'id':'1UEqIADV_tHic1Le0zlT25iYB7T6dBpBj'}]} pkl_dump = drive.CreateFile(dump_meta) pkl_dump.SetContentFile('CAS_num_strings.p') pkl_dump.Upload() print(pkl_dump.get('id')) Where

WebDriverException: Message: invalid argument: can't kill an exited process error with Selenium GeckoDriver and Firefox in Google Colab on Ubuntu

好久不见. 提交于 2019-12-02 08:35:03
In a previous post ( enter link description here ) the following code (by DebanjanB) # install firefox, geckodriver, and selenium !apt-get update !pip install selenium !apt install firefox-geckodriver !cp /usr/lib/geckodriver /usr/bin !cp /usr/lib/firefox /usr/bin from selenium import webdriver binary = '/usr/bin/firefox' options = webdriver.FirefoxOptions() options.binary = binary options.add_argument('start-maximized') options.add_argument('--headless') browser = webdriver.Firefox(firefox_options=options, executable_path='/usr/bin/geckodriver') browser.get('http://google.com/') which is

“UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80” while loading pickle file using pydrive on google colaboratory

我的未来我决定 提交于 2019-12-02 07:08:56
I am new to using google colaboratory (colab) and pydrive along with it. I am trying to load data in 'CAS_num_strings' which was written in a pickle file in a specific directory on my google drive using colab as: pickle.dump(CAS_num_strings,open('CAS_num_strings.p', 'wb')) dump_meta = {'title': 'CAS.pkl', 'parents': [{'id':'1UEqIADV_tHic1Le0zlT25iYB7T6dBpBj'}]} pkl_dump = drive.CreateFile(dump_meta) pkl_dump.SetContentFile('CAS_num_strings.p') pkl_dump.Upload() print(pkl_dump.get('id')) Where 'id':'1UEqIADV_tHic1Le0zlT25iYB7T6dBpBj' makes sure that it has a specific parent folder with this

Couldn't install textract in google colab

廉价感情. 提交于 2019-12-02 00:14:14
问题 I couldn't install textract in google colab, error message showing as below. some people suggest to use sudo apt-get install libasound2-dev but how to do sudo... in google colab? === error message ========================================================== Failed building wheel for pocketsphinx Running setup.py clean for pocketsphinx Failed to build pocketsphinx Installing collected packages: pocketsphinx Running setup.py install for pocketsphinx ... error Complete output from command /usr/bin

Image is not displaying in Google Colab while using imshow()

*爱你&永不变心* 提交于 2019-12-01 22:08:21
问题 I am working on a project which requires functions from OpenCV to plot images. I am trying to display image using the below code in Google Colab. But Nothing shows up in the output. Can anybody help me with this? %pylab notebook import cv2 testim = imread('butterfly.jpg') figure() imshow(testim) plt.show() Screenshot: enter image description here Link to my Colab Notebook 回答1: Found one workaround. We can use %matplotlib inline in the code to use imshow. Used as example here in In[28] - link

Couldn't install textract in google colab

回眸只為那壹抹淺笑 提交于 2019-12-01 22:07:36
I couldn't install textract in google colab, error message showing as below. some people suggest to use sudo apt-get install libasound2-dev but how to do sudo... in google colab? === error message ========================================================== Failed building wheel for pocketsphinx Running setup.py clean for pocketsphinx Failed to build pocketsphinx Installing collected packages: pocketsphinx Running setup.py install for pocketsphinx ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize; file ='/tmp/pip-install-03c_ysbm/pocketsphinx/setup.py';f

ValueError: Operation u'tpu_140462710602256/VarIsInitializedOp' has been marked as not fetchable

我的未来我决定 提交于 2019-12-01 21:43:00
The code works fine on GPU and CPU.But when I use keras_to_tpu_model function to make the model able to run on TPU, the error occurred. This is the full output on colab: https://colab.research.google.com/gist/WangHexie/2252beb26f16354cb6e9ba2639970e5b/tpu-error.ipynb Change runtype to TPU,I think this can be reproduced. Code on github: https://github.com/WangHexie/DHNE/blob/master/src/hypergraph_embedding.py#L60 You can test the code on GPU by changing to the gpu branch. Traceback Traceback (most recent call last): File "src/hypergraph_embedding.py", line 158, in <module> h.train(dataset) File

Cannot connect to X server GOOGLE COLAB

自作多情 提交于 2019-12-01 20:47:00
I am trying to make a prediction using Tensorflow Object Detection API on Google COLAB . Already I successfully completed the training process and Export Inference Graph task. But Problem is when I am going to make a new prediction it's throwing some error log. cannot connect to X server Now I am unable to make a new prediction. Some portion of my error log: totalMemory: 11.17GiB freeMemory: 6.65GiB 2019-02-07 15:08:38.398219: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2019-02-07 15:08:38.745889: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984

Test if notebook is running on Google Colab

血红的双手。 提交于 2019-12-01 19:00:04
How can I test if my notebook is running on Google Colab? I need this test as obtaining / unzipping my training data is different if running on my laptop or on Colab. Try importing google.colab try: import google.colab IN_COLAB = True except: IN_COLAB = False Or just check if it's in sys.modules import sys IN_COLAB = 'google.colab' in sys.modules Tom Hale In a %%bash cell, use: %%bash [[ ! -e /colabtools ]] && exit # Continue only if running on Google Colab # Do Colab-only stuff here Or in Python equivalence import os if os.path.exists('/colabtools'): # do stuff 来源: https://stackoverflow.com

Python basemap in google colaboratory

徘徊边缘 提交于 2019-12-01 18:29:07
问题 I used to use the following commands to install libgeos and basemap in google colaboratory and it worked perfectly until last week. !apt-get -qq install libgeos-dev !pip install -qq https://github.com/matplotlib/basemap/archive/master.zip from mpl_toolkits.basemap import Basemap, cm The error shows --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-3-f27b0fbc3a52> in <module>() ----> 1 from mpl_toolkits