Load/save .pt files

Extension files of type .pt are often used to save tensors;

load file

import torch

# Accuracy
# Accuracy = torch.load('path')
Accuracy = torch.load('experiments/Accuracy.pt')
print("Accuracy:")
print(Accuracy)

insert image description here

keep

import torch

# path写在右边
torch.save(pt,'Accuracy.pt')

Guess you like

Origin blog.csdn.net/qq_43585922/article/details/129460955
pt
Recommended