google-cloud-datalab

What is difference between AI Notebook and Cloud Datalab in GCP?

安稳与你 提交于 2021-01-24 07:22:26
问题 I have searched for an answer to this question and this question is duplicate but I need clarification as I looked at two different places and answers are a bit opposite. The following Stack Overflow answer mentions that Google Cloud AI Platform Notebooks is an upgraded version of Google Cloud Datalab . On the following Quora page, one of the architects mentions that Cloud Datalab is built on top of Jypyter Notebook . Cloud Datalab is adding a new network of its own. AI Notebooks remains

How do I use cv2.imread on a file stored in Google Cloud Storage?

喜欢而已 提交于 2020-05-15 19:06:50
问题 Say I have a picture titled sunset.jpg stored at the following URL on google cloud storage gs://example-bucket/testing_data so the full URL for the image is: gs://example-bucket/testing_data/sunset.jpg If I then do something like: image = cv2.imread('gs://example-bucket/testing_data/sunset.jpg') But while this doesn't crash or fail no image is loaded. How do I access/provide the right URL to cv2.imread to do this?? 回答1: import cv2 import numpy as np import urllib url = "https://i.stack.imgur

What is the difference between google cloud datalab and google cloud ai platform notebooks?

江枫思渺然 提交于 2020-01-24 10:51:11
问题 I'm looking into the best way to set up an end-to-end machine learning pipeline, and evaluating the data exploration component options. I'm trying to figure out the difference between google cloud datalab, and google cloud ai platform notebooks. They both seem to offer similar functionality, so not sure why they both exist, or whether one is a new iteration of the other. If they are different, what is the benefit of one over the other? 回答1: Google Cloud AI Platform Notebooks is effectively

TypeError: string argument without an encoding

我的梦境 提交于 2020-01-20 07:55:25
问题 I want to upload compressed gzip of Json into Google Storage. I have this code: import datalab.storage as storage import gzip path = prefix + '/orders_newline.json.gz' storage.Bucket('orders').item(path).write_to(gzip.compress(bytes(create_jsonlines(source)),encoding='utf8'), 'application/json') The create_jsonlines(source) is a function that returns Json Newline Delimited. Running this code gives: TypeError: string argument without an encoding The Python docs says the format is: bytes(

Is text the only content type for %%storage magic function in datalab

泄露秘密 提交于 2020-01-07 02:19:06
问题 I am working with he new cloud datalab and trying to save binary files to a GCS bucket using the magic function %%storage. For instance, I like to save PANDAS data frames (used to do it as pickle files) and mostly SciKitLearn model objects (after training). I have tried a few things with %%storage and no luck. It seems to me that %%storage is intended to work with text data only. Is this a correct? I have no issues with CSV files for instance. The parameters that I can provide for %%storage

How to keep Google Dataproc master running?

怎甘沉沦 提交于 2020-01-05 14:34:19
问题 I created a cluster on Dataproc and it works great. However, after the cluster is idle for a while (~90 min), the master node will automatically stops. This happens to every cluster I created. I see there is a similar question here: Keep running Dataproc Master node It looks like it's the initialization action problem. However the post does not give me enough info to fix the issue. Below are the commands I used to create the cluster: gcloud dataproc clusters create $CLUSTER_NAME \ --project

How to read audio file from google cloud storage bucket and play with ipd in a datalab notebook

旧巷老猫 提交于 2020-01-04 13:44:32
问题 I want to play a sound file in a datalab notebook which I read from a google cloud storage bucket. How to do this? 回答1: import numpy as np import IPython.display as ipd import librosa import soundfile as sf import io from google.cloud import storage BUCKET = 'some-bucket' # Create a Cloud Storage client. gcs = storage.Client() # Get the bucket that the file will be uploaded to. bucket = gcs.get_bucket(BUCKET) # specify a filename file_name = 'some_dir/some_audio.wav' # read a blob blob =

Can't deploy Google Cloud Datalab - Application in non-US zone

馋奶兔 提交于 2019-12-31 04:37:06
问题 I've selected my Google API project 4 times now and pushed "Deploy DataLab", but whenever I check back I have no Datalab project. The last time I had the following error message, but I have billing enabled, am the owner and the BigQuery/Google Compute Engine APIs are activated. Checking the logs it says I'm in the wrong region: Oct 13 19:42:35 datalab-deploy-main-20151013-19-40-34 startupscript: Pushing tag for rev [b886390e822d] on {https://gcr.io/v1/repositories/_m_sdk/mark-edmondson-gde

Adding python libraries to google datalab environment

喜你入骨 提交于 2019-12-30 09:45:35
问题 I'm using google datalab on google cloud platform. Worked great on the first try and I love how easy it is to now run a jupyter notebook server in the cloud (faster than starting up a localhost server). It's fantastic. But now I want to install python libraries not included in the basic datalab environment (specifically I need the Bokeh plotting library). So I opened a google cloud shell from the google cloud console where I manage this jupyter notebook instance, installed miniconda and then

How do I use gcp package from outside of google datalabs?

一个人想着一个人 提交于 2019-12-25 11:27:10
问题 I created a google compute instance with jupyter and I'd like to use all the nice things datalabs has. Is there a way to get the packages like gcp and the cellmagic like %%sql and %%storage. I found the packages gcloud and google-api-python-client but I don't know if it's the same thing. 回答1: https://github.com/googledatalab/datalab will give you Datalab-compatible functionality within Jupyter. Note, however, that the gcp.* prefix has changed to datalab. I.e. datalab.bigquery, datalab.storage