google / google/flax

checkpoints.restore_checkpoint` should raise an error for explicit paths that don't exist

Open
#1,631 2 comments 2 reactions 0 assignees View on GitHub
Priority: P2 - no schedule
Dominant language
Jupyter Notebook
Stars
7.3k
Forks
833
Avg merge
5h 11m
Merged PRs (30d)
5

Description

### Discussed in https://github.com/google/flax/discussions/1612

Originally posted by **PgLoLo** October 9, 2021
From documentation of `flax.training.checkpoints.restore_checkpoint`:
>Returns:
> Restored `target` updated from checkpoint file, or if no step specified and
> no checkpoint files present, returns the passed-in `target` unchanged.
> If a file path is specified and is not found, the passed-in `target` will be
> returned. This is to match the behavior of the case where a directory path
> is specified but the directory has not yet been created.

Why silently hiding the checkpoint absence (which is a great potential for a bug: by path misspecification, step misspecification, etc.) is a good idea? Makes no sense to me, is there any logic behind this decision?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.