简体   繁体   English

Pytorch转移学习预测

[英]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.

相关问题 PyTorch 带堆叠 LSTM 的闪电迁移学习 - PyTorch Lightning Transfer Learning with Stacked LSTM 如何在 PyTorch 中使用 Inception model 进行迁移学习? - How to use the Inception model for transfer learning in PyTorch? keras 模型上的迁移学习总是给出相同的预测 - Transfer learning on keras model always gives same predictions PyTorch:如何定义一个利用迁移学习的新神经网络 - PyTorch: How to define a new neural network that utilizes transfer learning PyTorch:如何在迁移学习教程中计算均值和标准差? - PyTorch: How do the means and stds get calculated in the Transfer Learning tutorial? PyTorch 迁移学习教程的混淆矩阵和测试准确率 - Confusion matrix and test accuracy for PyTorch Transfer Learning tutorial 如何使用超过1个GPU训练PyTorch转移学习教程 - How to train PyTorch transfer learning tutorial with more then 1 GPU 使用预先训练的ImageNet模型进行PyTorch传输学习 - PyTorch transfer learning with pre-trained ImageNet model 从预训练的火炬中获取最后一层以进行迁移学习? - Getting the last layer from a pretrained pytorch for transfer learning? 在 PyTorch 中加载用于推理的迁移学习模型的正确方法是什么? - What is the proper way to load a transfer learning model for inference in PyTorch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM