Skip to content

Commit

Permalink
Merge pull request #2812 from nouiz:imagenet_benchmark
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 510490709
  • Loading branch information
Flax Authors committed Feb 17, 2023
2 parents 5d4040a + da77531 commit 018725f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/imagenet/imagenet_fake_data_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/imagenet/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 018725f

Please sign in to comment.