Pytorch-lightning: Simplification: Merge load_from_metrics and load_from_checkpoint

Created on 1 Mar 2020  ·  3Comments  ·  Source: PyTorchLightning/pytorch-lightning

🚀 Feature

The two ways of loading a LightningModule from checkpoint only differ in one argument, the tags_csv.

Motivation

The code is almost identical for both and the purpose is the same. If we merge these two into one function, it would simplify the API.

Pitch

Combine
load_from_metrics(cls, weights_path, tags_csv, map_location=None) and
load_from_checkpoint(cls, checkpoint_path, map_location=None) into a single signature:

load_from_checkpoint(cls, checkpoint_path, tags_csv=None, map_location=None)

and make load_from_metrics deprecated.

Alternatives

keep as is, not a big deal :)

enhancement good first issue help wanted

Most helpful comment

Probably load_from_checkpoint as it used more often :) I already made PR :)

All 3 comments

let’s do it!

@awaelchli I agree, just which method shall be the remaining one?
load_from_metrics or load_from_checkpoint :]

Probably load_from_checkpoint as it used more often :) I already made PR :)

Was this page helpful?
0 / 5 - 0 ratings