Skip to content

Commit 88aaaea

Browse files
Setup training
1 parent 027e7f3 commit 88aaaea

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

examples/tensorflow/classification/configs/quantization/mobilenet_v2_imagenet_int8.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
},
77

88
"batch_size": 256,
9-
"epochs": 18,
9+
"epochs": 16,
1010
"num_classes": 1001,
1111
"dataset_preprocessing_preset": "imagenet2012_slim",
1212

1313
"optimizer": {
1414
"type": "Adam",
1515
"schedule_type": "piecewise_constant",
1616
"schedule_params": {
17-
"boundaries": [8, 12, 15],
18-
"values": [5e-4, 5e-5, 5e-6, 1e-6]
17+
"boundaries": [6, 10],
18+
"values": [1e-4, 1e-5, 1e-6]
1919
}
2020
},
2121

examples/tensorflow/classification/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ def run(config):
306306
logger.info('training...')
307307
compress_model.fit(
308308
train_dataset,
309-
epochs=1,#train_epochs,
310-
steps_per_epoch=3,#train_steps,
309+
epochs=train_epochs,
310+
steps_per_epoch=train_steps,
311311
initial_epoch=initial_epoch,
312312
callbacks=callbacks,
313313
**validation_kwargs)

op_insertion.py

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ def fq_creation(input_tensor, name, init_value=6):
204204
tf.io.write_graph(concrete.graph, '/tmp', 'mobilenetv2_sub_with_conv.pb')
205205

206206
def call(self, inputs, training=None):
207-
training = True
208207
model_obj = self.trainable_model if training else self.eval_model
209208
if isinstance(tf.distribute.get_strategy(), tf.distribute.MirroredStrategy):
210209
replica_context = tf.distribute.get_replica_context()

0 commit comments

Comments
 (0)