Technology Document Guide of TensorRT

Technology Document Guide of TensorRT

Abstract

本示例支持指南概述了GitHub和产品包中包含的所有受支持的TensorRT 7.2.1示例。TensorRT示例在推荐程序、机器翻译、字符识别、图像分类和对象检测等领域有特殊帮助。             

有关TensorRT开发文档,请参阅TensorRT归档文件。

  1. 1.    Introduction

下面的示例展示了如何在许多用例中使用TensorRT,同时突出显示接口的不同功能。

 

 

 

 

 

 

  

1.1.  Getting Started With C++ Samples

You can find the C++ samples in the /usr/src/tensorrt/samples package directory as well as on GitHub. The following C++ samples are shipped with TensorRT.

Getting Started With C++ Samples

每个C++样本包括一个GitHub中的README.md文件,该文件提供有关示例如何工作的详细信息、示例代码以及有关如何运行和验证其输出的分步说明。

Running C++ Samples on Linux

如果使用Debian文件安装TensorRT,在构建C++示例之前,首先复制/usr/src/tensorrt到新目录。如果使用tar文件安装了TensorRT,那么示例位于{TAR_EXTRACT_PATH}/samples中。要生成所有示例,然后运行其中一个示例,请使用以下命令:

$ cd <samples_dir>

$ make -j4

$ cd ../bin

$ ./<sample_bin>

Running C++ Samples on Windows

Windows上的所有C++样本都作为VisualStudio解决方案文件提供。若要生成示例,请打开其相应的VisualStudio解决方案文件并生成解决方案。输出可执行文件将在(ZIP_EXTRACT_PATH)\bin中生成。然后可以直接或通过visual studio运行可执行文件。

1.2.  Getting Started With Python Samples

可以在/usr/src/tensorrt/samples/python包目录中找到Python示例。以下Python示例随TensorRT一起提供。

Getting Started With Python Samples

每个Python示例都包含README.md文件。请参阅

/usr/src/tensorrt/samples/python/<sample-name>/README.md文件获取有关示例如何工作的详细信息、示例代码以及有关如何运行和验证其输出的分步说明。

Running Python Samples

要运行其中一个Python示例,该过程通常包括两个步骤:

  1. Install the sample requirements:
  1. python<x> -m pip install -r requirements.txt

where python<x> is either python2 or python3.

  1. Run the sample code with the data directory provided if the TensorRT sample data is not in the default location. For example:

python<x> sample.py [-d DATA_DIR]

For more information on running samples, see the README.md file included with the sample.

 

posted @   吴建明wujianming  阅读(232)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示