Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from torchvision.utils import save_image
features, imgs, labels, image_path = get_features_trained_weight(model, transform_dataset)
img1 = imgs[1] #第1張圖片
img1 = torch.from_numpy(img1) #格式轉換
save_image(img1, 'img1.png') #保存成'img1.png'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment