Open shijinjin12 opened 1 month ago
This should be the path to the linear transformation model that you trained. See "Training the model" section in the ReadMe. We have completed the "Training LinearnTransformation module" step according to the readme documentation and have generated the following file under the output folder, But we don't know which file is required for "pretrained_linear_transform"
It’s the path to the file best_model.pth
Thank you very much for your answer. I'll have a try!
It’s the path to the file best_model.pth
We placed best_model.pth generated in the previous step according to your method, but the following error occurred. We are not sure what the problem is, and would like to ask you for advice
Ah I see. best_model.pth
contains the model as well as the optimizer and other information required to restart training if necessary. Try doing this in a python console:
checkpoint_path = <set this as the path to best_model.pth from the linear transformation training>
model = torch.load(checkpoint_path, map_location=torch.device("cpu"))["model"]
save_path = <set this as the path where you would like to save the linear transform>
torch.save(model, save_path)
This should extract just the trained model and save it at save_path
.
When you are training the flow module, set pretrained_linear_transform
to save_path
that you used above.
Ah I see.
best_model.pth
contains the model as well as the optimizer and other information required to restart training if necessary. Try doing this in a python console:checkpoint_path = <set this as the path to best_model.pth from the linear transformation training> model = torch.load(checkpoint_path, map_location=torch.device("cpu"))["model"] save_path = <set this as the path where you would like to save the linear transform> torch.save(model, save_path)
This should extract just the trained model and save it at
save_path
. When you are training the flow module, setpretrained_linear_transform
tosave_path
that you used above. It really works. Thank you very much!
Glad it works!
Arjun Narayanan
On Tue, May 28, 2024 at 6:34 PM shijinjin12 @.***> wrote:
Ah I see. best_model.pth contains the model as well as the optimizer and other information required to restart training if necessary. Try doing this in a python console:
checkpoint_path =
model = torch.load(checkpoint_path, map_location=torch.device("cpu"))["model"] save_path = torch.save(model, save_path) This should extract just the trained model and save it at save_path. When you are training the flow module, set pretrained_linear_transform to save_path that you used above. It really works. Thank you very much!
— Reply to this email directly, view it on GitHub https://github.com/ArjunNarayanan/LinFlo-Net/issues/3#issuecomment-2136359050, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSMYZPVQHVP5QW5IBWOVHDZEUWD5AVCNFSM6AAAAABIGXXHRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZWGM2TSMBVGA . You are receiving this because you commented.Message ID: @.***>
This should be the path to the linear transformation model that you trained. See "Training the model" section in the ReadMe.