mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-07-12 20:25:39 +08:00
add cross platform training and inference (#27)
Adapt model deserialization to support between cpu training and gpu inference and viceversa
This commit is contained in:
committed by
GitHub Enterprise
parent
ecc31f6082
commit
1be0a7b305
@@ -175,7 +175,7 @@ class PTSPredictor(Predictor):
|
||||
model_name = 'prediction_net'
|
||||
with (path / f"{model_name}-network.json").open("r") as fp:
|
||||
prediction_net = load_json(fp.read())
|
||||
prediction_net.load_state_dict(torch.load(path / "prediction_net"))
|
||||
prediction_net.load_state_dict(torch.load(path / "prediction_net", map_location=device))
|
||||
|
||||
# input_names is derived from the prediction_net
|
||||
if "input_names" in parameters:
|
||||
|
||||
Reference in New Issue
Block a user