Commit 669807e6 authored by vishnubanna's avatar vishnubanna
Browse files

tfds csp

parent 868cea8f
runtime: runtime:
distribution_strategy: 'mirrored' distribution_strategy: 'mirrored'
mixed_precision_dtype: 'float16' mixed_precision_dtype: 'float16'
loss_scale: 'dynamic'
num_gpus: 2
task: task:
model: model:
num_classes: 1001 num_classes: 1001
...@@ -12,28 +14,29 @@ task: ...@@ -12,28 +14,29 @@ task:
losses: losses:
l2_weight_decay: 0.0005 l2_weight_decay: 0.0005
one_hot: True one_hot: True
label_smoothing: 0.1
train_data: train_data:
tfds_name: 'imagenet2012' tfds_name: 'imagenet2012'
tfds_split: 'train' tfds_split: 'train'
tfds_data_dir: '~/tensorflow_datasets/' tfds_data_dir: '~/tensorflow_datasets/'
tfds_download: true tfds_download: true
is_training: true is_training: true
global_batch_size: 128 global_batch_size: 16 #default = 128
dtype: 'float16' dtype: 'float16'
shuffle_buffer_size: 100
validation_data: validation_data:
tfds_name: 'imagenet2012' tfds_name: 'imagenet2012'
tfds_split: 'validation' tfds_split: 'validation'
tfds_data_dir: '~/tensorflow_datasets/' tfds_data_dir: '~/tensorflow_datasets/'
tfds_download: true tfds_download: true
is_training: true is_training: true
global_batch_size: 128 global_batch_size: 16 #default = 128
dtype: 'float16' dtype: 'float16'
drop_remainder: false drop_remainder: false
shuffle_buffer_size: 100
trainer: trainer:
train_steps: 1200000 # epochs: 120 train_steps: 9600000 # epochs: 120, 1200000 * 128/batchsize
validation_steps: 400 # size of validation data validation_steps: 3200 # size of validation data, 400 * 128/batchsize
validation_interval: 500 # 10000 validation_interval: 10000 #10000
steps_per_loop: 10000 steps_per_loop: 10000
summary_interval: 10000 summary_interval: 10000
checkpoint_interval: 10000 checkpoint_interval: 10000
...@@ -45,11 +48,11 @@ trainer: ...@@ -45,11 +48,11 @@ trainer:
learning_rate: learning_rate:
type: 'polynomial' type: 'polynomial'
polynomial: polynomial:
initial_learning_rate: 0.1 initial_learning_rate: 0.0125 # 0.1 * batchsize/128, default = 0.1
end_learning_rate: 0.0001 end_learning_rate: 0.0000125 # 0.0001 * batchsize/128, default = 0.0001
power: 4.0 power: 4.0
decay_steps: 1190000 decay_steps: 9592000 # 790000 * 128/batchsize, default = 800000 - 1000 = 799000
warmup: warmup:
type: 'linear' type: 'linear'
linear: linear:
warmup_steps: 1000 #learning rate rises from 0 to 0.1 over 1000 steps warmup_steps: 8000 # 0 to 0.1 over 1000 * 128/batchsize, default = 128
...@@ -20,9 +20,6 @@ from official.vision.beta.dataloaders import decoder ...@@ -20,9 +20,6 @@ from official.vision.beta.dataloaders import decoder
from official.vision.beta.dataloaders import parser from official.vision.beta.dataloaders import parser
from official.vision.beta.ops import preprocess_ops from official.vision.beta.ops import preprocess_ops
MEAN_RGB = (0.485 * 255, 0.456 * 255, 0.406 * 255)
STDDEV_RGB = (0.229 * 255, 0.224 * 255, 0.225 * 255)
class Decoder(decoder.Decoder): class Decoder(decoder.Decoder):
"""A tf.Example decoder for classification task.""" """A tf.Example decoder for classification task."""
......
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