mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-15 00:36:55 +08:00
fixed pytest error in CI
This commit is contained in:
@@ -200,7 +200,7 @@ class Trainer:
|
|||||||
|
|
||||||
if ckpt_path is not None:
|
if ckpt_path is not None:
|
||||||
_logger.info("Resuming states from %s", str(ckpt_path))
|
_logger.info("Resuming states from %s", str(ckpt_path))
|
||||||
self.load_state_dict(torch.load(ckpt_path))
|
self.load_state_dict(torch.load(ckpt_path, weights_only=False))
|
||||||
else:
|
else:
|
||||||
self.initialize()
|
self.initialize()
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ def test_trainer_checkpoint():
|
|||||||
assert (output_dir / "002.pth").exists()
|
assert (output_dir / "002.pth").exists()
|
||||||
assert os.readlink(output_dir / "latest.pth") == str(output_dir / "002.pth")
|
assert os.readlink(output_dir / "latest.pth") == str(output_dir / "002.pth")
|
||||||
|
|
||||||
trainer.load_state_dict(torch.load(output_dir / "001.pth"))
|
trainer.load_state_dict(torch.load(output_dir / "001.pth", weights_only=False))
|
||||||
assert trainer.current_iter == 1
|
assert trainer.current_iter == 1
|
||||||
assert trainer.current_episode == 100
|
assert trainer.current_episode == 100
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user