ai: kwargs in from_checkpoint

This commit is contained in:
Starbeamrainbowlabs 2022-09-14 17:11:06 +01:00
parent 6bda24d4da
commit 1e682661db
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 2 additions and 5 deletions

View file

@ -51,10 +51,7 @@ class RainfallWaterContraster(object):
} }
@staticmethod @staticmethod
def from_checkpoint(filepath_checkpoint, filepath_hyperparams=None): def from_checkpoint(filepath_checkpoint, **hyperparams):
if not filepath_checkpoint:
filepath_hyperparams = find_paramsjson(filepath_checkpoint)
hyperparams = json.loads(readfile(filepath_hyperparams))
return RainfallWaterContraster(filepath_checkpoint=filepath_checkpoint, **hyperparams) return RainfallWaterContraster(filepath_checkpoint=filepath_checkpoint, **hyperparams)

View file

@ -47,7 +47,7 @@ def run(args):
filepath_output = args.output if hasattr(args, "output") and args.output != None else "-" filepath_output = args.output if hasattr(args, "output") and args.output != None else "-"
ai = RainfallWaterContraster.from_checkpoint(args.checkpoint) ai = RainfallWaterContraster.from_checkpoint(args.checkpoint, **json.loads(readfile(args.params)))
sys.stderr.write(f"\n\n>>> This is TensorFlow {tf.__version__}\n\n\n") sys.stderr.write(f"\n\n>>> This is TensorFlow {tf.__version__}\n\n\n")