TensorRT笔记(2)使用Python API

目录

  • 3.1将TensorRT导入Python
  • 3.2 在Python中创建网络定义
    • 3.2.1 使用Python API从头开始创建网络定义
    • 3.2.2 在Python中使用解析器导入模型
    • 3.2.3 使用Python从Caffe导入
    • 3.2.4 使用Python从TensorFlow导入
    • 3.2.5 使用Python从ONNX导入
    • 3.2.6 从PyTorch和其他框架导入
  • 3.3 用Python构建引擎
  • 3.4 在Python中序列化模型
  • 3.5 在Python中执行推理

3.1将TensorRT导入Python

程序
导入TensorRT:

import tensorrt as trt

实施一个日志记录界面,TensorRT通过该界面报告错误,警告和参考消息。以下代码显示了如何实现日志记录接口。在

你可能感兴趣的:(TensorRT-部署-加速)