From 84ade75bc3e8fc671bca4da02d3e9bd137e54b1f Mon Sep 17 00:00:00 2001 From: Frederic Bastien Date: Thu, 19 Jan 2023 16:06:45 +0000 Subject: [PATCH 1/2] Doc a script requirement --- examples/imagenet/imagenet_fake_data_benchmark.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/imagenet/imagenet_fake_data_benchmark.py b/examples/imagenet/imagenet_fake_data_benchmark.py index 4701c0d63..032bf7201 100644 --- a/examples/imagenet/imagenet_fake_data_benchmark.py +++ b/examples/imagenet/imagenet_fake_data_benchmark.py @@ -12,7 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Benchmark for the ImageNet example using fake data for quick perf results.""" +"""Benchmark for the ImageNet example using fake data for quick perf results. + +This script doesn't need the dataset, but it needs the dataset metadata. +That can be fetched with the script `flax/tests/download_dataset_metadata.sh`. +""" import pathlib import time From da7753166695e9b718c1c2060d96aa120ea45a88 Mon Sep 17 00:00:00 2001 From: Frederic Bastien Date: Thu, 19 Jan 2023 16:07:07 +0000 Subject: [PATCH 2/2] Currently, by default, num_train_steps is 0, not -1. --- examples/imagenet/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/imagenet/train.py b/examples/imagenet/train.py index f3544a9b0..b7328f0c4 100644 --- a/examples/imagenet/train.py +++ b/examples/imagenet/train.py @@ -289,7 +289,7 @@ def train_and_evaluate(config: ml_collections.ConfigDict, dataset_builder.info.splits['train'].num_examples // config.batch_size ) - if config.num_train_steps == -1: + if config.num_train_steps <= 0: num_steps = int(steps_per_epoch * config.num_epochs) else: num_steps = config.num_train_steps