Commit 65da497f authored by Shining Sun's avatar Shining Sun
Browse files

Merge branch 'master' of https://github.com/tensorflow/models into cifar_keras

parents 93e0022d 7d032ea3
...@@ -21,7 +21,7 @@ from tensorflow.core.example import example_pb2 ...@@ -21,7 +21,7 @@ from tensorflow.core.example import example_pb2
from tensorflow.core.example import feature_pb2 from tensorflow.core.example import feature_pb2
from tensorflow.python.framework import dtypes from tensorflow.python.framework import dtypes
from tensorflow.python.ops import parsing_ops from tensorflow.python.ops import parsing_ops
from lstm_object_detection import tf_sequence_example_decoder from lstm_object_detection.inputs import tf_sequence_example_decoder
from object_detection.core import standard_fields as fields from object_detection.core import standard_fields as fields
......
...@@ -48,8 +48,8 @@ import os ...@@ -48,8 +48,8 @@ import os
from absl import flags from absl import flags
import tensorflow as tf import tensorflow as tf
from lstm_object_detection import model_builder from lstm_object_detection import model_builder
from lstm_object_detection import seq_dataset_builder
from lstm_object_detection import trainer from lstm_object_detection import trainer
from lstm_object_detection.inputs import seq_dataset_builder
from lstm_object_detection.utils import config_util from lstm_object_detection.utils import config_util
from object_detection.builders import preprocessor_builder from object_detection.builders import preprocessor_builder
......
...@@ -23,6 +23,8 @@ oid_hierarchical_labels_expansion.py \ ...@@ -23,6 +23,8 @@ oid_hierarchical_labels_expansion.py \
--annotation_type=<1 (for boxes) or 2 (for image-level labels)> --annotation_type=<1 (for boxes) or 2 (for image-level labels)>
""" """
from __future__ import print_function
import argparse import argparse
import json import json
...@@ -154,7 +156,7 @@ def main(parsed_args): ...@@ -154,7 +156,7 @@ def main(parsed_args):
if parsed_args.annotation_type == 2: if parsed_args.annotation_type == 2:
labels_file = True labels_file = True
elif parsed_args.annotation_type != 1: elif parsed_args.annotation_type != 1:
print '--annotation_type expected value is 1 or 2.' print('--annotation_type expected value is 1 or 2.')
return -1 return -1
with open(parsed_args.input_annotations, 'r') as source: with open(parsed_args.input_annotations, 'r') as source:
with open(parsed_args.output_annotations, 'w') as target: with open(parsed_args.output_annotations, 'w') as target:
......
...@@ -208,7 +208,7 @@ For running the training Cloud ML job, we'll configure the cluster to use 5 ...@@ -208,7 +208,7 @@ For running the training Cloud ML job, we'll configure the cluster to use 5
training jobs and three parameters servers. The training jobs and three parameters servers. The
configuration file can be found at `object_detection/samples/cloud/cloud.yml`. configuration file can be found at `object_detection/samples/cloud/cloud.yml`.
Note: This sample is supported for use with 1.8 runtime version. Note: The code sample below is supported for use with 1.9 runtime version.
To start training and evaluation, execute the following command from the To start training and evaluation, execute the following command from the
`tensorflow/models/research/` directory: `tensorflow/models/research/` directory:
...@@ -216,7 +216,7 @@ To start training and evaluation, execute the following command from the ...@@ -216,7 +216,7 @@ To start training and evaluation, execute the following command from the
```bash ```bash
# From tensorflow/models/research/ # From tensorflow/models/research/
gcloud ml-engine jobs submit training `whoami`_object_detection_pets_`date +%m_%d_%Y_%H_%M_%S` \ gcloud ml-engine jobs submit training `whoami`_object_detection_pets_`date +%m_%d_%Y_%H_%M_%S` \
--runtime-version 1.8 \ --runtime-version 1.9 \
--job-dir=gs://${YOUR_GCS_BUCKET}/model_dir \ --job-dir=gs://${YOUR_GCS_BUCKET}/model_dir \
--packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz,/tmp/pycocotools/pycocotools-2.0.tar.gz \ --packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz,/tmp/pycocotools/pycocotools-2.0.tar.gz \
--module-name object_detection.model_main \ --module-name object_detection.model_main \
...@@ -248,6 +248,8 @@ web browser. You should see something similar to the following: ...@@ -248,6 +248,8 @@ web browser. You should see something similar to the following:
![](img/tensorboard.png) ![](img/tensorboard.png)
Make sure your Tensorboard version is the same minor version as your Tensorflow (1.x)
You will also want to click on the images tab to see example detections made by You will also want to click on the images tab to see example detections made by
the model while it trains. After about an hour and a half of training, you can the model while it trains. After about an hour and a half of training, you can
expect to see something like this: expect to see something like this:
......
trainingInput: trainingInput:
runtimeVersion: "1.8" runtimeVersion: "1.9"
scaleTier: CUSTOM scaleTier: CUSTOM
masterType: standard_gpu masterType: standard_gpu
workerCount: 5 workerCount: 5
......
...@@ -27,9 +27,8 @@ parser.add_argument('--train_steps', default=1000, type=int, ...@@ -27,9 +27,8 @@ parser.add_argument('--train_steps', default=1000, type=int,
help='number of training steps') help='number of training steps')
def my_model(features, labels, mode, params): def my_model(features, labels, mode, params):
"""DNN with three hidden layers, and dropout of 0.1 probability.""" """DNN with three hidden layers and learning_rate=0.1."""
# Create three fully connected layers each layer having a dropout # Create three fully connected layers.
# probability of 0.1.
net = tf.feature_column.input_layer(features, params['feature_columns']) net = tf.feature_column.input_layer(features, params['feature_columns'])
for units in params['hidden_units']: for units in params['hidden_units']:
net = tf.layers.dense(net, units=units, activation=tf.nn.relu) net = tf.layers.dense(net, units=units, activation=tf.nn.relu)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment