Commit f1e8e671 authored by Vishnu Banna's avatar Vishnu Banna
Browse files

rm change to orbit in final, testing backbone training

parent eeb371d4
This diff is collapsed.
runtime:
distribution_strategy: 'mirrored'
mixed_precision_dtype: 'float16'
loss_scale: 'dynamic'
num_gpus: 2
task:
annotation_file: Null
init_checkpoint: Null
model:
num_classes: 80
input_size: [640, 640, 3]
min_level: 3
max_level: 7
losses:
l2_weight_decay: 0.0001
train_data:
input_path: Null
tfds_name: 'coco/2017'
tfds_split: 'train'
tfds_download: True
is_training: True
global_batch_size: 16
dtype: 'float16'
cycle_length: 5
decoder:
type: tfds_decoder
shuffle_buffer_size: 2
validation_data:
input_path: Null
tfds_name: 'coco/2017'
tfds_split: 'validation'
tfds_download: True
# tfds_skip_decoding_feature: source_id,image,height,width,groundtruth_classes,groundtruth_is_crowd,groundtruth_area,groundtruth_boxes
is_training: False
global_batch_size: 16
dtype: 'float16'
cycle_length: 10
decoder:
type: tfds_decoder
shuffle_buffer_size: 2
trainer:
train_steps: 532224
validation_steps: 1564
validation_interval: 2000
steps_per_loop: 200 #59136
summary_interval: 200 #59136
checkpoint_interval: 10000
optimizer_config:
optimizer:
type: 'sgd'
sgd:
momentum: 0.9
# learning_rate:
# type: 'cosine'
# cosine:
# initial_learning_rate: 0.0021875
# decay_steps: 4257792
# alpha: 0.01
# Stepwise version
learning_rate:
type: 'stepwise'
stepwise:
# boundaries: [26334, 30954]
boundaries: [421344, 495264]
# values: [0.28, 0.028, 0.0028]
values: [0.0175, 0.00175, 0.000175]
warmup:
type: 'linear'
linear:
warmup_steps: 20480
warmup_learning_rate: 0.0001634375
This diff is collapsed.
......@@ -16,14 +16,16 @@ task:
train_data:
tfds_name: 'imagenet2012'
tfds_split: 'train'
tfds_data_dir: '~/tensorflow_datasets'
tfds_data_dir: '~/tensorflow_datasets/'
tfds_download: true
is_training: true
global_batch_size: 128
dtype: 'float16'
validation_data:
tfds_name: 'imagenet2012'
tfds_split: 'validation'
tfds_data_dir: '~/tensorflow_datasets'
tfds_data_dir: '~/tensorflow_datasets/'
tfds_download: true
is_training: true
global_batch_size: 128
dtype: 'float16'
......
......@@ -15,14 +15,16 @@ task:
train_data:
tfds_name: 'imagenet2012'
tfds_split: 'train'
tfds_data_dir: '~/tensorflow_datasets'
tfds_data_dir: '~/tensorflow_datasets/'
tfds_download: true
is_training: true
global_batch_size: 128
dtype: 'float16'
validation_data:
tfds_name: 'imagenet2012'
tfds_split: 'validation'
tfds_data_dir: '~/tensorflow_datasets'
tfds_data_dir: '~/tensorflow_datasets/'
tfds_download: true
is_training: true
global_batch_size: 128
dtype: 'float16'
......
......@@ -35,6 +35,8 @@ FLAGS = flags.FLAGS
def main(_):
gin.parse_config_files_and_bindings(FLAGS.gin_file, FLAGS.gin_params)
params = train_utils.parse_configuration(FLAGS)
import pprint
pprint.pprint(params.as_dict())
model_dir = FLAGS.model_dir
if 'train' in FLAGS.mode:
# Pure eval modes do not output yaml files. Otherwise continuous eval job
......
......@@ -81,8 +81,9 @@ def make_distributed_dataset(strategy, dataset_or_fn, *args, **kwargs):
if "input_context" in arg_names:
kwargs["input_context"] = input_context
return dataset_or_fn(*args, **kwargs)
return strategy.distribute_datasets_from_function(dataset_fn)
return strategy.experimental_distribute_datasets_from_function(dataset_fn)
#return strategy.distribute_datasets_from_function(dataset_fn)
def get_value(x):
......
runtime:
distribution_strategy: 'mirrored'
mixed_precision_dtype: 'float32'
loss_scale: 'dynamic'
num_gpus: 1
task:
init_checkpoint: Null
model:
num_classes: 80
input_size: [640, 640, 3]
min_level: 3
max_level: 7
losses:
l2_weight_decay: 0.0001
train_data:
input_path: Null
tfds_name: 'coco/2017'
tfds_split: 'train'
tfds_download: True
is_training: True
global_batch_size: 2
dtype: 'float16'
cycle_length: 5
decoder:
type: tfds_decoder
shuffle_buffer_size: 2
validation_data:
input_path: Null
tfds_name: 'coco/2017'
tfds_split: 'validation'
tfds_download: True
# tfds_skip_decoding_feature: source_id,image,height,width,groundtruth_classes,groundtruth_is_crowd,groundtruth_area,groundtruth_boxes
is_training: False
global_batch_size: 2
dtype: 'float16'
cycle_length: 10
decoder:
type: tfds_decoder
shuffle_buffer_size: 2
trainer:
train_steps: 4257792
validation_steps: 2500
validation_interval: 5000
steps_per_loop: 100 #59136
summary_interval: 100 #59136
checkpoint_interval: 59136
optimizer_config:
optimizer:
type: 'sgd'
sgd:
momentum: 0.9
# learning_rate:
# type: 'cosine'
# cosine:
# initial_learning_rate: 0.0021875
# decay_steps: 4257792
# alpha: 0.01
# Stepwise version
learning_rate:
type: 'stepwise'
stepwise:
# boundaries: [26334, 30954]
boundaries: [3370752, 3962112]
# values: [0.28, 0.028, 0.0028]
values: [0.0021875, 0.00021875, 0.000021875]
warmup:
type: 'linear'
linear:
warmup_steps: 64000
warmup_learning_rate: 0.0000523
import tensorflow_datasets as tfds
import tensorflow as tf
from official.vision.beta.dataloaders import decoder
import matplotlib.pyplot as plt
import cv2
class TfdsExampleDecoder(decoder.Decoder):
"""Tensorflow Dataset Example proto decoder."""
def __init__(self,
include_mask=False,
regenerate_source_id=False):
self._include_mask = include_mask
self._regenerate_source_id = regenerate_source_id
def decode(self, serialized_example):
"""Decode the serialized example.
Args:
serialized_example: a single serialized tf.Example string.
Returns:
decoded_tensors: a dictionary of tensors with the following fields:
- source_id: a string scalar tensor.
- image: a uint8 tensor of shape [None, None, 3].
- height: an integer scalar tensor.
- width: an integer scalar tensor.
- groundtruth_classes: a int64 tensor of shape [None].
- groundtruth_is_crowd: a bool tensor of shape [None].
- groundtruth_area: a float32 tensor of shape [None].
- groundtruth_boxes: a float32 tensor of shape [None, 4].
- groundtruth_instance_masks: a float32 tensor of shape
[None, None, None].
- groundtruth_instance_masks_png: a string tensor of shape [None].
"""
decoded_tensors = {
'source_id': serialized_example['image/id'],
'image': serialized_example['image'],
'height': tf.shape(serialized_example['image'])[0],
'width': tf.shape(serialized_example['image'])[1],
'groundtruth_classes': serialized_example['objects']['label'],
'groundtruth_is_crowd': serialized_example['objects']['is_crowd'],
'groundtruth_area': serialized_example['objects']['area'],
'groundtruth_boxes': serialized_example['objects']['bbox'],
}
return decoded_tensors
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