Analysis get_best_checkpoint returning None

I’m having trouble when trying to retrieve the trial best checkpoint, this is an example inside the training loop where I’m checkpointing my metrics

metrics = {"loss": val_loss, "running_loss": running_loss}
            with tune.checkpoint_dir(epoch) as checkpoint_dir:
                path = os.path.join(checkpoint_dir, "checkpoint")
                torch.save((model, optimizer.state_dict()), path)
                with open(path, "w") as f:
                    f.write(json.dumps(metrics))
            tune.report(metrics)

when tryind result.get_best_checkpoint it returns None, what am I doing wrong?

Hi @0piero ,

Please refer to the example script for checkpointing by custom criteria: ray/checkpoint_by_custom_criteria.py at master · ray-project/ray · GitHub

If this does not help you, could you please post this as a reproducible script?
What you are doing is not 100% clear to me.

Thanks you :slightly_smiling_face: