Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 1d11290

Browse files
Cleanup
1 parent f404a72 commit 1d11290

File tree

6 files changed

+7
-283
lines changed

6 files changed

+7
-283
lines changed

tftrt/examples/benchmark_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def _post_process_args(self, args):
322322

323323
if args.num_iterations is None:
324324
args.num_iterations = (
325-
self.SAMPLES_IN_VALIDATION_SET // args.batch_size
325+
max((args.total_max_samples // args.batch_size) + 1, 1000)
326326
)
327327

328328
return args

tftrt/examples/image_classification.py

Lines changed: 0 additions & 275 deletions
This file was deleted.

tftrt/examples/image_classification/image_classification.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939

4040
class CommandLineAPI(BaseCommandLineAPI):
4141

42-
SAMPLES_IN_VALIDATION_SET = 50000
43-
4442
def __init__(self):
4543
super(CommandLineAPI, self).__init__()
4644

tftrt/examples/image_classification/scripts/base_script.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ do
3333
MODEL_DIR="${arg#*=}"
3434
shift # Remove --input_saved_model_dir= from processing
3535
;;
36+
--total_max_samples=*)
37+
shift # Remove --total_max_samples= from processing
38+
;;
3639
--output_tensors_name=*)
3740
shift # Remove --output_tensors_name= from processing
3841
;;
@@ -51,6 +54,7 @@ done
5154
INPUT_SIZE=224
5255
PREPROCESS_METHOD="vgg"
5356
NUM_CLASSES=1001
57+
MAX_SAMPLES=49920
5458
OUTPUT_TENSORS_NAME="logits"
5559

5660
case ${MODEL_NAME} in
@@ -107,6 +111,7 @@ echo ""
107111
echo "[*] INPUT_SIZE: ${INPUT_SIZE}"
108112
echo "[*] PREPROCESS_METHOD: ${PREPROCESS_METHOD}"
109113
echo "[*] NUM_CLASSES: ${NUM_CLASSES}"
114+
echo "[*] MAX_SAMPLES: ${MAX_SAMPLES}"
110115
echo "[*] OUTPUT_TENSORS_NAME: ${OUTPUT_TENSORS_NAME}"
111116
echo ""
112117
echo "[*] TF_AUTO_JIT_XLA_FLAG: ${TF_AUTO_JIT_XLA_FLAG}"
@@ -163,7 +168,7 @@ COMMAND="${PREPEND_COMMAND} python image_classification.py \
163168
--input_size ${INPUT_SIZE} \
164169
--preprocess_method ${PREPROCESS_METHOD} \
165170
--num_classes ${NUM_CLASSES} \
166-
--total_max_samples=49920 \
171+
--total_max_samples=${MAX_SAMPLES} \
167172
--output_tensors_name=${OUTPUT_TENSORS_NAME} \
168173
${BYPASS_ARGUMENTS}"
169174

tftrt/examples/object_detection/object_detection.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242

4343
class CommandLineAPI(BaseCommandLineAPI):
4444

45-
SAMPLES_IN_VALIDATION_SET = 50000
46-
4745
def __init__(self):
4846
super(CommandLineAPI, self).__init__()
4947

tftrt/examples/transformers/transformers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444

4545
class CommandLineAPI(BaseCommandLineAPI):
4646

47-
# SAMPLES_IN_VALIDATION_SET = 50000
48-
4947
ALLOWED_VOCAB_SIZES = [
5048
30522, # BERT Uncased
5149
28996, # BERT Cased

0 commit comments

Comments
 (0)