
Pytorch
文章平均质量分 55
令狐傻笑
图像算法工程师,主要研究方向为图像分类,目标检测
展开
-
基于pytorch和torchvision实现DeformableConv
相关代码如下:import torchimport torchvision.opsfrom torch import nnclass DeformableConv2d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,原创 2021-10-13 17:20:49 · 2706 阅读 · 2 评论 -
基于PyTorch的卷积神经网络图像分类——猫狗大战(二):使用Pytorch定义网络模型
文章目录1. 需要用到的库2. 模型定义3. 测试基于上一篇文章https://blog.youkuaiyun.com/linghu8812/article/details/100044971,这次介绍一下网络模型的定义。1. 需要用到的库import torchimport torch.nn as nnfrom torchvision.models import resnet50基于ResNet50定义网络模型,在此基础上进行微调。2. 模型定义class CatVSDogNet(nn.Module原创 2021-07-27 17:08:19 · 865 阅读 · 0 评论 -
mmpose PyTorch模型转TensorRT
文章目录mmpose PyTorch模型转TensorRT1. github开源代码2. PyTorch模型转ONNX模型3. ONNX模型转TensorRT模型3.1 概述3.2 编译3.3 运行4. 推理结果mmpose PyTorch模型转TensorRT1. github开源代码yolov5 TensorRT推理的开源代码位置在https://github.com/linghu8812/tensorrt_inference/tree/master/mmpose,PyTorch转onnx的代码是原创 2021-03-06 09:10:25 · 1459 阅读 · 4 评论 -
深度学习模型PyTorch训练并转ONNX与TensorRT部署
深度学习模型PyTorch训练与TensorRT部署原创 2020-10-06 15:25:19 · 2296 阅读 · 1 评论 -
Ubuntu18.04 基于detectron2实现Faster RCNN训练VOC数据(二)
1.准备VOC数据下载VOC数据,将VOC数据放在datasets文件夹下,VOC2007和VOC2012两个文件夹分开放,文件夹下结构不用改变。datasets|----VOC2007|----VOC20122. 数据训练通过以下命令开始训练。CUDA_VISIBLE_DEVICES=0 python3 train_net.py \ --config-file ../confi...原创 2020-04-23 15:48:34 · 3325 阅读 · 2 评论 -
Ubuntu18.04 配置detectron2实现Faster RCNN目标检测和Mask RCNN实例分割(一)
1. 背景介绍detectron2项目地址:https://github.com/facebookresearch/detectron2FasterRCNN论文:https://arxiv.org/abs/1506.01497COCO数据集:http://cocodataset.org/#homeVOC数据集:http://host.robots.ox.ac.uk/pascal/VOC/...原创 2020-04-23 10:53:27 · 4278 阅读 · 11 评论 -
基于PyTorch实现cosine learning rate
1.需要用到的库设置学习率和模型import mathimport matplotlib.pyplot as pltimport torch.optim as optimfrom torchvision.models import resnet18lr_rate = 0.1model = resnet18(num_classes=10)2.LambdaLR实现cosine...原创 2020-03-26 16:49:55 · 6597 阅读 · 0 评论 -
基于PyTorch的卷积神经网络图像分类——猫狗大战(一):使用Pytorch定义DataLoader
目录1. 需要用到的库2. 数据扩充定义3. 自定义Dataset4. 测试 开始一个新的系列,基于Kaggle比赛的猫狗大战数据集,基于PyTorch实现猫狗图像分类。 数据集地址在:https://www.kaggle.com/c/dogs-vs-cats-redux-kernels-edition/overview。 ...原创 2019-08-23 23:01:38 · 4611 阅读 · 0 评论 -
PyTorch学习——Andrew Ng machine-learning-ex1 Linear Regression实现
目录Exercise 1: Linear Regression1. Linear模型2. 读取数据3.线性回归4.数据测试Exercise 1: Linear RegressionNg老师的作业使用python即可实现,使用pytorch实现是为了加深对机器学习算法和pytorch使用的理解。需要用到的库import pandas as pdimport n...原创 2019-04-30 15:50:23 · 306 阅读 · 0 评论 -
PyTorch学习——Andrew Ng machine-learning-ex4 Neural Networks Learning
目录Exercise 4: Neural Networks Learning1. Neural Networks模型2. 加载数据3. 网络训练4.结果比较4.1 激活函数比较4.2 隐藏层个数比较Exercise 4: Neural Networks Learning需要用到的库import numpy as npimport scipy.ioi...原创 2019-05-03 23:14:20 · 513 阅读 · 0 评论 -
PyTorch学习——Andrew Ng machine-learning-ex3 Multi-class Classification实现
目录Exercise 3: Multi-class Classification1. Logistic 模型2. 读取数据3.Logistic 回归4.其他尝试4.1修改Linear层的初始化权重4.2修改weight_decay值Exercise 3: Multi-class Classification基于pytorch,只实现作业中多类别分类问题。需要...原创 2019-05-03 14:40:30 · 319 阅读 · 0 评论 -
PyTorch学习——Andrew Ng machine-learning-ex2 Logistic Regression实现
目录Exercise 2: Logistic Regression1. Logistic 模型2. 读取数据3.Logistic 回归4.正则化Logistic 回归Exercise 2: Logistic Regression需要用到的库import pandas as pdimport numpy as npimport matplotlib.pyplot...原创 2019-05-02 12:31:37 · 252 阅读 · 0 评论