pytorch1.7教程实验——迁移学习训练卷积神经网络进行图像分类
只是贴上跑通的代码以供参考学习
参考网址:迁移学习训练卷积神经网络进行图像分类
需要用到的数据集下载网址: https://download.pytorch.org/tutorial/hymenoptera_data.zip
完整的代码如下:
# License: BSD
# Author: Sasank Chilamkurthy
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import numpy as np
import torchvision
from torchvision import datasets, models, transfor
共有 0 条评论