摘要: //欢迎指正!!!////有向图找环//输入n条边 const int maxvex = 500; int graph[maxvex][maxvex] = {0};//邻接矩阵 set<int>vexs;//顶点容器 bool visitted[maxvex] = {false};//访问数组 ve 阅读全文
posted @ 2020-08-16 18:32 卡冈图雅blackhole 阅读(464) 评论(0) 推荐(0) 编辑
摘要: struct Node { int val; Node* next; Node* random; Node(int x, Node* pt1, Node* pt2) :val(x), next(pt1), random(pt2) {} }; class Solution { public: Node 阅读全文
posted @ 2020-08-12 11:52 卡冈图雅blackhole 阅读(149) 评论(0) 推荐(0) 编辑
摘要: struct BinaryTreeNode { int nvalue=0; BinaryTreeNode* pleft = nullptr; BinaryTreeNode* pright = nullptr; BinaryTreeNode* parent = nullptr;};准备一个队列,通过不 阅读全文
posted @ 2020-07-18 18:22 卡冈图雅blackhole 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 一、写在开头 1、基于PyTorch训练出cifar10模型 2、以ONNX(Open Neural Network Exchange)格式导出模型cifar10.onnx 3、下载cifar10二进制版本数据集 4、创建TensorRT(vs c++)项目,解析模型,进行推理 二、基于PyTorc 阅读全文
posted @ 2020-06-07 19:55 卡冈图雅blackhole 阅读(1249) 评论(0) 推荐(0) 编辑
摘要: 一、引子//Windows tf(keras)训练好了模型,想要用Nvidia-TensorRT来重构训练好的模型为TRT推理引擎加快推理的速度。 二、准备文件 1、训练好模型以后(keras)可以通过以下方式保存keras模型为h5文件 tf.keras.models.save_model(mod 阅读全文
posted @ 2020-05-21 18:51 卡冈图雅blackhole 阅读(4061) 评论(0) 推荐(0) 编辑
摘要: 一、概括 TensorRT作为英伟达深度学习系列SDK的一部分,是一个高性能(HP)的深度学习推理优化器,可以为深度学习应用提供一个低延迟、高吞吐量的推理部署。基于TensorRT的应用推理性能上是只用CPU时的40多倍(版本TensorRT 7.0)。使用TensorRT,你可以优化现在几乎所有主 阅读全文
posted @ 2020-04-20 23:14 卡冈图雅blackhole 阅读(1147) 评论(0) 推荐(0) 编辑
摘要: //读取二进制xxx.bin文件并逐个字节解析//2019.11.10 #include<iostream> #include<fstream> #include<vector> using namespace std; int main(int argc, char** argv) { size_ 阅读全文
posted @ 2020-04-11 21:20 卡冈图雅blackhole 阅读(5772) 评论(0) 推荐(0) 编辑
摘要: 一、保存模型 mynetwork为keras模型对象,通过mynetwork = tf.keras.models.Sequential(...)类似方法建立;tf.saved_model.save(mynetwork, 'saved_model')##保存模型,说明文件夹即可 二、载入保存的模型并进 阅读全文
posted @ 2020-03-31 16:14 卡冈图雅blackhole 阅读(1879) 评论(0) 推荐(0) 编辑
摘要: 一、构建模型 from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf from tensorflow.keras.layers import 阅读全文
posted @ 2020-03-31 00:44 卡冈图雅blackhole 阅读(925) 评论(0) 推荐(0) 编辑