mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
pytorch - trainer - add device arg to load method
This commit is contained in:
parent
0c9aa86885
commit
49a7de4ebd
|
@ -182,8 +182,8 @@ class PyTorchModelTrainer(PyTorchTrainerInterface):
|
|||
"pytrainer": self
|
||||
}, path)
|
||||
|
||||
def load(self, path: Path):
|
||||
checkpoint = torch.load(path)
|
||||
def load(self, path: Path, device: str = None):
|
||||
checkpoint = torch.load(path, map_location=device)
|
||||
return self.load_from_checkpoint(checkpoint)
|
||||
|
||||
def load_from_checkpoint(self, checkpoint: Dict):
|
||||
|
|
Loading…
Reference in New Issue
Block a user