google-colaboratory

Upload local files using Google Colab

六月ゝ 毕业季﹏ 提交于 2019-11-27 06:53:32
问题 Trying to upload local files using Google Collaboratory this way: from google.colab import files uploaded = files.upload() I get the following error: Upload widget is only available when the cell has been executed in the current browser session. Please rerun this cell to enable. I rerun the cell but it doesn't work... 回答1: It sounds like third-party cookies may be disabled in your browser, see https://github.com/googlecolab/colabtools/issues/17. The setting is under chrome://settings/content

Using Kaggle Datasets in Google Colab

时间秒杀一切 提交于 2019-11-27 06:45:49
Is it possible to use any datasets available via the kaggle API in Google Colab? I see the Kaggle API is used in this Colab notebook , but it's a bit unclear to me what datasets it provides access to. Step-by-step -- Create an API key in Kaggle. To do this, go to kaggle.com/ and open your user settings page. Next, scroll down to the API access section and click generate to download an API key. This will download a file called kaggle.json to your computer. You'll use this file in Colab to access Kaggle datasets and competitions. Navigate to https://colab.research.google.com/. Upload your kaggle

Colaboratory: Can I access to my Google drive folder and file?

回眸只為那壹抹淺笑 提交于 2019-11-27 06:37:52
Google Colaboratory is really cool, but it would be more useful if I can access all my google drive files, without using standard google drive API. Is it possible and easy? and how? Here's an example of using a FUSE Drive interface to access your Drive files like local files: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q In short: # Load the Drive helper and mount from google.colab import drive drive.mount('/content/drive') After executing the code above, your Drive files will be present in /content/drive/My Drive . I'm guessing you also found the bundled

Plotly notebook mode with google colaboratory

末鹿安然 提交于 2019-11-27 04:30:39
I am am trying out colaboratory with plotly notebook mode - I open a new notebook, copy and paste the following simple example from plotly's documentation, but don't see an output. There is a large blank in the output space where the plot whould normally be. This works fine in my local notebook (which is a newer version of plotly, but per their docs offline mode should work with the google colab version) Any ideas? import plotly from plotly.graph_objs import Scatter, Layout plotly.offline.init_notebook_mode(connected=True) plotly.offline.iplot({ "data": [Scatter(x=[1, 2, 3, 4], y=[4, 3, 2, 1])

WebDriverException: Message: Service /content/chromedriver unexpectedly exited. Status code was: -6 with ChromeDriver Google Colab and Selenium

时光毁灭记忆、已成空白 提交于 2019-11-27 02:59:59
问题 I was trying to run headless chrome browser using selenium to scrape contents from the web. I installed headless chrome using wget and then unzipped in my current folder. !wget "http://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip" !unzip chromedriver_linux64.zip Now when I am loading the driver from selenium.webdriver.chrome.options import Options import os # instantiate a chrome options object so you can set the size and headless preference chrome_options = Options()

Unknown initializer: GlorotUniform when loading Keras model

老子叫甜甜 提交于 2019-11-27 02:34:59
问题 I trained my CNN (VGG) through google colab and generated .h5 file. Now problem is, I can predict my output successfully through google colab but when i download that .h5 trained model file and try to predict output on my laptop, I am getting error when loading the model. Here is the code: import tensorflow as tf from tensorflow import keras import h5py # Initialization loaded_model = keras.models.load_model('./train_personCount_model.h5') And the error: ValueError: Unknown initializer:

read csv to dataframe in google colab

做~自己de王妃 提交于 2019-11-27 00:55:53
问题 I am trying to read a csv file which I stored locally on my machine. (Just for additional reference it is titanic data from Kaggle which is here.) From this question and answers I learnt that you can import data using this code which works well from me. from google.colab import files uploaded = files.upload() Where I am lost is how to convert it to dataframe from here. The sample google notebook page listed in the answer above does not talk about it. I am trying to convert the dictionary

What's the hardware spec for Google Colaboratory?

会有一股神秘感。 提交于 2019-11-27 00:38:19
问题 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? 回答1: 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 回答2: Here I run some test. https://colab.research.google.com

Load local data files to Colaboratory

不打扰是莪最后的温柔 提交于 2019-11-26 22:38:46
问题 I just wondering that is it possible to load local data files(like .xlsx or .csv files that on my google drive) into Colaboratory? 回答1: I was a bit confused by the example for loading local files on first glance as there was no place to specify a file path. All you need to do is copy and paste the recipe to figure this out, but to be clear: from google.colab import files uploaded = files.upload() will open an upload dialogue window where you can browse and select your local files for upload.

How can I open images in a Google Colaboratory notebook cell from uploaded png files?

时光毁灭记忆、已成空白 提交于 2019-11-26 20:55:10
问题 I am working with a Google Colaboratory notebook. I uploaded a file named bp.png into the working directory, and I can see that the file is in there by running !ls in a code cell. Then I try this piece of code to see the image in a markdown cell: <h2 align="center">Image</h2> <img src="bp.png" width="600"> But the Colab notebook's cell stays empty after running that (except for the header), although if I run this in a local Jupyter notebook the image does appear in the cell in that local