Allent's Blogs


  • Home

  • About

  • Tags

  • Categories

  • Archives

libtorch教程(三)

Posted on 2021-01-16 | Visitors:
基本模块搭建模块化编程的思想非常重要,通过模块化编程可以大幅减少重复的敲代码过程,同时代码可读性也会增加。本章将讲述如何使用libtorch搭建一些MLP和CNN的基本模块。 MLP基本单元首先是线性层的声明和定义,包括初始化和前向传播函数。代码如下: 12345678910111213141516 ...
Read more »

libtorch教程(二)

Posted on 2021-01-16 | Visitors:
张量初始化libtorch(pytorch c++)的大多数api和pytorch保持一致,因此,libtorch中张量的初始化也和pytorch中的类似。本文介绍四种深度图像编程需要的初始化方法。第一种,固定尺寸和值的初始化。 123456//常见固定值的初始化方式auto b = torch:: ...
Read more »

libtorch教程(一)

Posted on 2021-01-16 | Visitors:
前言本教程旨在教读者如何用c++写模型,训练模型,根据模型预测对象。为便于教学和使用,本文的c++模型均使用libtorch(或者pytorch c++ api)完成搭建和训练等。目前,国内各大平台似乎没有pytorch在c++上api的完整教学,也没有基于c++开发的完整的深度学习开源模型。可能原 ...
Read more »

一些cpp常见错误报错

Posted on 2021-01-06 | Visitors:
Debug Assertion Failed! Expression: _BLOCK_TYPE_IS_VALID这个错误的产生原因较多,网上查询的结果多为重复删除指针导致的重复释放内存。然而本文遇到的并非如此,本文遇到的情况是clone了一个GitHub开源项目——亚像素提取使用时产生的错误。 环境 ...
Read more »

NMS的几种写法

Posted on 2020-12-24 | In python | Visitors:
NMS的numpy写法简单易懂的NMS的numpy写法目标检测中的NMS,输入:boxes形如N*5,N个(x1,y1,x2,y2,score), thresh阈值为float型。 计算时,首先获取基于分数的降序排序order,计算全部box的面积area,对每个得分最高的boxes[i],计算与其 ...
Read more »

computer ABC

Posted on 2020-12-23 | Visitors:
堆,栈,队列栈栈(stack):栈像个桶,先进后出。 12#include<stack> 队列队列(queue):就像食堂打饭,先进先出 长期更新中…
Read more »

L1,L2损失与L1,L2正则化

Posted on 2020-12-20 | Visitors:
L1和L2是指范数,分别为1范数和2范数。 损失L1损失MAE(Mean absolute error)损失就是L1损失,目标值$\boldsymbol{y}$,目标函数$f(\cdot)$,输入值$\boldsymbol{x}$,则: $$\begin{aligned} L_1 && ...
Read more »

pytorch部署torchscript篇

Posted on 2020-12-16 | In pytorch | Visitors:
引言本文旨在介绍如何在Windows平台使用pytorch的c++ api部署pytorch的CNN模型,本文的部署的模型只有推理功能,这是由于torch::jit不支持部分层或者操作的反向传播。当然即使只是推理也足够许多项目运行了,部署使用的工具有visual studio,opencv,libt ...
Read more »

Wind10环境,Visual Studio2017下用Bazel编译Tensorflow(失败转调用编译好的包配置使用Tensorflowc++)

Posted on 2020-12-16 | Visitors:
工具和环境 Windows10; VS2017; CUDA9.0; CUDnn9.0(v7 for CUDA9.0); eigen3; bazel-0.24.1-windows-x86_64(版本不是关键,旧版的话会提示你更新); Anaconda3 64bit 地址 https://www.ana ...
Read more »

QT Creator + Opencv + Libtorch +CUDA English

Posted on 2020-03-05 | Visitors:
Download and install QT Creator, configure the environment. Note that the MSVC compiler component is checked during installation. Use MSVC to compile ...
Read more »
<i class="fa fa-angle-left"></i>123<i class="fa fa-angle-right"></i>

30 posts
2 categories
11 tags
GitHub E-Mail Bilibili
© 2024 Allent Dan
本站访客数 人次 本站总访问量 次