当前位置:网站首页>ncnn 推理猫狗识别
ncnn 推理猫狗识别
2022-08-09 07:50:00 【HySmiley】
实现流程:
一、训练模型
准备数据集,编辑代码进行训练。下载内容在文章末尾。
import torch
import torch.nn as nn
import torchvision.models as models
from torchvision import datasets, transforms
from torch.autograd import Variable
import torch.optim as optim
import os
from trainlog import acc_lossHistory
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"
class resnet18(nn.Module):
def __init__(self, num_classes=2):
super(resnet18, self).__init__()
net = models.resnet18(pretrained=True)
# net.classifier = nn.Sequential()
net.fc=nn.Sequential()
self.features = net
self.fc = nn.Sequential(
nn.Line
边栏推荐
猜你喜欢
随机推荐
yolov5 detects the number of labels in the dataset
SDRAM的数据存储实现并对其数据进行读写操作
链表专项练习(四)
Codeforces Round #359 (Div. 2) C. Robbers' watch 暴力枚举
Invoker 2019CCPC秦皇岛站I题 简单DP
MUV LUV EXTRA 2019CCPC Qinhuangdao Station J Question KMP
Tkinter可以选择的颜色
View log common commands
[STL]vector
低成本、大容量、高交互…Polkadot 引领 GameFi 实现新突破
工信部等四部门推动绿色智能家居产品下乡
更改Jupyter Notebook默认打开目录
sklearn数据预处理
解决pycharm每次新建项目都要重新pip安装一些第三方库等问题
4.MySQL更新和删除数据
Learning Notes---Machine Learning
C language: adjust the order of odd and even numbers
我的创作纪念日
LeetCode·每日一题·761.特殊的二进制序列·分治
Invoker 2019CCPC Qinhuangdao Station I Question Simple DP