Fix exposure encoding checkpoint loading
This commit is contained in:
@@ -67,7 +67,12 @@ def main() -> None:
|
|||||||
if output_path.exists() and not args.overwrite:
|
if output_path.exists() and not args.overwrite:
|
||||||
raise FileExistsError(f"{output_path} exists; pass --overwrite")
|
raise FileExistsError(f"{output_path} exists; pass --overwrite")
|
||||||
|
|
||||||
checkpoint_data = torch.load(args.checkpoint, map_location="cpu")
|
try:
|
||||||
|
checkpoint_data = torch.load(
|
||||||
|
args.checkpoint, map_location="cpu", weights_only=False
|
||||||
|
)
|
||||||
|
except TypeError:
|
||||||
|
checkpoint_data = torch.load(args.checkpoint, map_location="cpu")
|
||||||
model_cfg = checkpoint_data["model_config"]
|
model_cfg = checkpoint_data["model_config"]
|
||||||
normalization = checkpoint_data["normalization"]
|
normalization = checkpoint_data["normalization"]
|
||||||
encoder = TimesNetExposureEncoder(
|
encoder = TimesNetExposureEncoder(
|
||||||
|
|||||||
Reference in New Issue
Block a user