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鈥檚 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

Related issues

Dunrar picture Dunrar  路  45Comments

BraveDistribution picture BraveDistribution  路  31Comments

polars05 picture polars05  路  34Comments

lorenzoFabbri picture lorenzoFabbri  路  34Comments

hadim picture hadim  路  29Comments