logo
down
shadow

Tensorflow object detection train.py fails when running on cloud machine learning engine


Tensorflow object detection train.py fails when running on cloud machine learning engine

By : BobMiller
Date : October 17 2020, 01:08 AM
it fixes the issue I have a small working example of the tensorflow object detection api working locally. Everything looks great. My goal is to use their scripts to run in Google Machine Learning Engine, which i've used extensively in the past. I am following these docs. , The root cause is a slight typo:
code :
--pipeline_config_path= ${PIPELINE_CONFIG_PATH}
gcloud ml-engine jobs submit training "${JOB_ID}_train" \
    --job-dir=${TRAIN_DIR} \
    --packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz \
    --module-name object_detection.train \
    --region us-central1 \
    --config ${PIPELINE_YAML} \
    -- \
    --train_dir=${TRAIN_DIR} \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH}


Share : facebook icon twitter icon
Locally load saved tensorflow model .pb from google cloud machine learning engine

Locally load saved tensorflow model .pb from google cloud machine learning engine


By : Ravshanbek Norboev
Date : March 29 2020, 07:55 AM
it should still fix some issue The format of the model you deployed to the CloudML Engine service is a SavedModel. Loading a SavedModel in Python is fairly simple using the loader module:
code :
import tensorflow as tf

with tf.Session(graph=tf.Graph()) as sess:
   tf.saved_model.loader.load(
       sess,
       [tf.saved_model.tag_constants.SERVING],
       path_to_model)
# Feed the image_data as input to the graph and get first prediction
softmax_tensor = sess.graph.get_tensor_by_name('conv1/weights:0')

predictions = sess.run(softmax_tensor, \
                       {'DecodeJpeg/contents:0': [image_data]})

# Sort to show labels of first prediction in order of confidence
top_k = predictions[0].argsort()[-len(predictions[0]):][::-1]

for node_id in top_k:
    human_string = label_lines[node_id]
    score = predictions[0][node_id]
    print('%s (score = %.5f)' % (human_string, score))
Using keras flow_from_directory when running on google cloud machine learning engine

Using keras flow_from_directory when running on google cloud machine learning engine


By : Sunil Narlawar
Date : March 29 2020, 07:55 AM
seems to work fine Yes, you can first download the images from GCS to the VM using os.system('gstuil cp YOUR_IMAGES .').
Error in Tensorflow Object Detection running on Cloud ML: no module object_detection.train

Error in Tensorflow Object Detection running on Cloud ML: no module object_detection.train


By : Kythor
Date : March 29 2020, 07:55 AM
will be helpful for those in need I assumed you're using the unmodified object detection sample. According to https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_pets.md#starting-training-and-evaluation-jobs-on-google-cloud-ml-engine, the --module-name should be object_detection.model_main instead of object_detection.train. Could you please double check in your dist/object_detection-0.1.tar.gz file?
Cloud Machine Learning Engine fails to deploy model

Cloud Machine Learning Engine fails to deploy model


By : zw1127
Date : March 29 2020, 07:55 AM
it should still fix some issue Turns out your GCS bucket and the trained model needs to be in the same region. This was not explained well in the Cloud ML tutorial, where it only says:
code :
Note: Use the same region where you plan on running Cloud ML Engine jobs. The example uses us-central1 because that is the region used in the getting-started instructions.
How to train Keras model on Google Cloud Machine Learning Engine

How to train Keras model on Google Cloud Machine Learning Engine


By : nati
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I found out that in order to use keras on google cloud one has to install it with a setup.py script and put it on the same place folder where you run the gcloud command:
shadow
Privacy Policy - Terms - Contact Us © soohba.com