google-cloud-ml

Submitting a Training Job to Google Cloud ML

白昼怎懂夜的黑 提交于 2019-12-09 01:00:32
问题 I have a code as below that I want to submit to Google cloud ml. I already tested their example and got results. from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np # Data sets I_TRAINING = "/home/android/Desktop/training.csv" I_TEST = "/home/android/Desktop/test.csv" # Load datasets. training_set = tf.contrib.learn.datasets.base.load_csv(filename=I_TRAINING, target_dtype=np.int) test_set = tf

Checkpoint file not found, restoring evaluation graph

China☆狼群 提交于 2019-12-08 13:31:07
问题 I have a model which runs in a distributed mode for 4000 steps. After every 120s the accuracies are calculated (as is done in the provided examples). However, at times the last checkpoint file is not found. Error: Couldn't match files for checkpoint gs://path-on-gcs/train/model.ckpt-1485 The checkpoint file is present at the location. A local run for 2000 steps runs perfectly. last_checkpoint = tf.train.latest_checkpoint(train_dir(FLAGS.output_path)) I assume that the checkpoint is still in

Cloud ML Engine distributed training default type for custom tf.estimator

守給你的承諾、 提交于 2019-12-08 11:40:27
问题 This article suggests there are three options for distributed training Data-parallel training with synchronous updates. Data-parallel training with asynchronous updates. Model-parallel training. The tutorial then goes on to suggest that the code that follows performs data-parallel training with asynchronous updates on Cloud ML Engine which behaves as "If you distribute 10,000 batches among 10 worker nodes, each node works on roughly 1,000 batches." However, it's not clear what portion of the

Google Cloud ML Engine + Tensorflow perform preprocessing/tokenization in input_fn()

让人想犯罪 __ 提交于 2019-12-08 08:17:30
问题 I want to perform basic preprocessing and tokenization within my input function. My data is contained in csv's in a google cloud storage bucket location (gs://) that I cannot modify. Further, I to perform any modifications on input text within my ml-engine package so that the behavior can be replicated at serving time. my input function follows the basic structure below: filename_queue = tf.train.string_input_producer(filenames) reader = tf.TextLineReader() _, rows = reader.read_up_to

Input instances are not in JSON format

一世执手 提交于 2019-12-08 07:23:13
问题 I'm practicing GCP ML engine using Google's public templates and examples located here After I ran the code in the example "housing-regression" LOCALLY , the model was successfully generated. However, in prediction, an error was raised ERROR: (gcloud.ml-engine.local.predict) Input instances are not in JSON format. See "gcloud ml-engine predict --help" for details. The codes I ran is in local-train.sh gcloud ml-engine local predict --model-dir=${MODEL_LOCATION} --json-instances=data/new-data

Import Error: no module named cloud.ml

余生长醉 提交于 2019-12-08 07:12:24
问题 I am trying to follow the instructions to use local predictions in tensorflow as described here. Running the command gcloud ml-engine local predict --model-dir=~/PycharmProjects/nlc/export/1/ --json-instances=test.json gives me the error: ERROR: (gcloud.ml-engine.local.predict) Cannot import google.cloud.ml. Please verify "python -c 'import google.cloud.ml'" works. Please verify the installed cloudml sdk version with: "python -c 'import google.cloud.ml as cloudml; print cloudml.__version__'".

ScikitLearn model giving 'LocalOutlierFactor' object has no attribute 'predict' Error

徘徊边缘 提交于 2019-12-08 06:45:58
问题 I'm new to machine learning world and I have built and trained a ml model using ScikitLearn library.It works perfectly well in the Jupyter notebook but when I deployed this model to Google Cloud ML and try to serve it using a Python script, it throws an error. Here's a snippet from my model code: Updated: from sklearn.metrics import classification_report, accuracy_score from sklearn.ensemble import IsolationForest from sklearn.neighbors import LocalOutlierFactor # define a random state state

How to use tf.contrib.estimator.forward_features

六月ゝ 毕业季﹏ 提交于 2019-12-08 03:34:23
问题 I'm trying to use forward_features to get instance keys for cloudml, but I always get errors that I'm not sure how to fix. The preprocessing section that uses tf.Transform is a modification of https://github.com/GoogleCloudPlatform/cloudml-samples/tree/master/reddit_tft where the instance key is a string and everything else is a bunch of floats. def gzip_reader_fn(): return tf.TFRecordReader(options=tf.python_io.TFRecordOptions( compression_type=tf.python_io.TFRecordCompressionType.GZIP)) def

Invalid character found in base64 while using a deployed model on cloudml

爱⌒轻易说出口 提交于 2019-12-08 03:15:53
问题 For better context, I have uploaded a pre-trained model on cloud ml. It's an inceptionV3 model converted from keras to acceptable format in tensorflow. from keras.applications.inception_v3 import InceptionV3 model = InceptionV3(weights='imagenet') from keras.models import Model intermediate_layer_model = Model(inputs=model.input,outputs=model.layers[311].output) with tf.Graph().as_default() as g_input: input_b64 = tf.placeholder(shape=(1,), dtype=tf.string, name='input') input_bytes = tf

Pickled scipy sparse matrix as input data?

谁都会走 提交于 2019-12-07 23:32:57
问题 I am working on a multiclass classification problem consisting in classifying resumes. I used sklearn and its TfIdfVectorizer to get a big scipy sparse matrix that I feed in a Tensorflow model after pickling it. On my local machine, I load it, convert a small batch to dense numpy arrays and fill a feed dictionnary. Everything works great. Now I would like to do the same thing on ML cloud. My pickle is stored at gs://my-bucket/path/to/pickle but when I run my trainer, the pickle file can't be