Open
Description
I saved weight file as below.
import torch
from torchvision import models
// Download and load the pre-trained model
model = models.densenet121(pretrained=True)
print(model)
// Set upgrading the gradients to False
for param in model.parameters():
param.requires_grad = False
modelname = 'densenet121.pt'
example_input = torch.rand(1, 3, 224, 224)
script_module = torch.jit.trace(model, example_input)
script_module.save(modelname)
and then,
DenseNet model;
std::cout << model << std::endl;
model.apply(init_weights);
torch::load(model, "densenet121.pt"); <= void load(Value& value, LoadFromArgs&&... args) { ... archive >> value; } unhandled exception happened ㅠㅠ
Thank you in advance for your future help^^
Metadata
Metadata
Assignees
Labels
No labels