Skip to content

Getting ValueError Error when using ModelCheckpoint with auto_insert_metric_name=False #16385

Discussion options

You must be logged in to vote

Hi @dongchirua, I found this issue by debugging pytorch_lightning/callbacks/model_checkpoint.py #L524

    def _format_checkpoint_name(
        cls,
        filename: Optional[str],
        metrics: Dict[str, Tensor],
        prefix: str = "",
        auto_insert_metric_name: bool = True,
    ) -> str:
        if not filename:
            # filename is not set, use default name
            filename = "{epoch}" + cls.CHECKPOINT_JOIN_CHAR + "{step}"

        # check and parse user passed keys in the string
        groups = re.findall(r"(\{.*?)[:\}]", filename)
        if len(groups) >= 0:
            for group in groups:
                name = group[1:]

                if auto_insert_metric…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by quy-ng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment