[英]Pytorch transfer learning predictions
I have been following the pytorch transfer learning tutorial,and following the tutorial to my own dataset i have arrived at this 我一直在关注pytorch转移学习教程,并且在将教程转到自己的数据集之后,我得出了这个结论
model_conv = train_model(model_conv, criterion, optimizer_conv,
exp_lr_scheduler, num_epochs=25)
Epoch 1/1
......
......
......
Epoch 24/24
train Loss: 0.8674 Acc: 0.5784
val Loss: 1.2930 Acc: 0.4583
Training complete in 43m 24s
Best val Acc: 0.486111
The tutorial ends here,but im not exaclty sure how do i get predictions for my new images? 本教程到此结束,但是我不确定该如何获得新图像的预测?
Any suggestions would be really helpful. 任何建议都会很有帮助。 Thanks in advance.
提前致谢。
只需将新图像(与训练数据集中的图像格式相同)输入模型:
labels = model_conv(new_images)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.