1.到pytorch的官网下载libtorch,可放在任意位置.
2.在python下保存c++可调用的模型.保存代码如下:
net.cpu().eval()
# An example input you would normally provide to your model's forward() method.
#example = torch.rand(1, 4)
example = torch.ones(1, 4)
#out = net(example)
#print(out)
1.到pytorch的官网下载libtorch,可放在任意位置.
2.在python下保存c++可调用的模型.保存代码如下:
net.cpu().eval()
# An example input you would normally provide to your model's forward() method.
#example = torch.rand(1, 4)
example = torch.ones(1, 4)
#out = net(example)
#print(out)