Skip to content

Commit 8f661b4

Browse files
committed
yolov4 migrated to trt7
1 parent 9b83cbf commit 8f661b4

13 files changed

+1003
-535
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ I wrote this project to get familiar with tensorrt API, and also to share and le
88

99
All the models are implemented in pytorch first, and export a weights file xxx.wts, and then use tensorrt to load weights, define network and do inference. Some pytorch implementations can be found in my repo [Pytorchx](https://github.com/wang-xinyu/pytorchx), the remaining are from polular open-source pytorch implementations.
1010

11-
## Getting Started
11+
# News
1212

13-
There is a guide for quickly getting started, taking lenet5 as a demo. [Getting_Started.](./getting_started)
13+
- `22 May 2020`. A new branch [trt4](https://github.com/wang-xinyu/tensorrtx/tree/trt4) created, which is using TensorRT 4 API. Now the master branch is using TensorRT 7 API. But only `yolov4` has been migrated to TensorRT 7 API for now. The rest will be migrated soon. And a tutorial for `migarating from TensorRT 4 to 7` provided.
1414

15-
## Test Environment
15+
## Tutorials
1616

17-
1. Jetson TX1 / Ubuntu16.04 / cuda9.0 / cudnn7.1.5 / tensorrt4.0.2 / nvinfer4.1.3 / opencv3.3
17+
- [A guide for quickly getting started, taking lenet5 as a demo.](./tutorials/getting_started.md)
18+
- [Migrating from TensorRT 4 to 7](./tutorials/migrating_from_tensorrt_4_to_7.md)
1819

19-
2. GTX1080 / Ubuntu16.04 / cuda10.0 / cudnn7.6.5 / tensorrt7.0.0 / nvinfer7.0.0 / opencv3.3
20+
## Test Environment
2021

21-
Currently, TX1/TX2 and x86 GTX1080 were tested. trt4 api were using, some APIs are deprecated in trt7, but still can compile successfully.
22+
1. GTX1080 / Ubuntu16.04 / cuda10.0 / cudnn7.6.5 / tensorrt7.0.0 / nvinfer7.0.0 / opencv3.3
2223

2324
## How to run
2425

@@ -74,9 +75,9 @@ Some tricky operations encountered in these models, already solved, but might ha
7475
|-|-|:-:|:-:|:-:|:-:|
7576
| YOLOv3(darknet53) | Xavier | 1 | FP16 | 320x320 | 55 |
7677
| YOLOv3-spp(darknet53) | Xeon E5-2620/GTX1080 | 1 | FP32 | 256x416 | 94 |
77-
| YOLOv4(CSPDarknet53) | Xeon E5-2620/GTX1080 | 1 | FP32 | 256x416 | 59 |
78-
| YOLOv4(CSPDarknet53) | Xeon E5-2620/GTX1080 | 4 | FP32 | 256x416 | 74 |
79-
| YOLOv4(CSPDarknet53) | Xeon E5-2620/GTX1080 | 8 | FP32 | 256x416 | 83 |
78+
| YOLOv4(CSPDarknet53) | Xeon E5-2620/GTX1080 | 1 | FP16 | 608x608 | 35.7 |
79+
| YOLOv4(CSPDarknet53) | Xeon E5-2620/GTX1080 | 4 | FP16 | 608x608 | 40.9 |
80+
| YOLOv4(CSPDarknet53) | Xeon E5-2620/GTX1080 | 8 | FP16 | 608x608 | 41.3 |
8081
| RetinaFace(resnet50) | TX2 | 1 | FP16 | 384x640 | 15 |
8182
| RetinaFace(resnet50) | Xeon E5-2620/GTX1080 | 1 | FP32 | 928x1600 | 15 |
8283

File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Migrating from TensorRT 4 to 7
2+
3+
The following APIs are deprecated and replaced in TensorRT 7.
4+
5+
- `DimsCHW`, replaced by `Dims3`
6+
- `addConvolution()`, replaced by `addConvolutionNd()`
7+
- `addPooling()`, replaced by `addPoolingNd()`
8+
- `addDeconvolution()`, replaced by `addDeconvolutionNd()`
9+
- `createNetwork()`, replaced by `createNetworkV2()`
10+
- `buildCudaEngine()`, replaced by `buildEngineWithConfig()`
11+
- `createPReLUPlugin()`, replaced by `addActivation()` with `ActivationType::kLEAKY_RELU`
12+
- `IPlugin` and `IPluginExt` class, replaced by `IPluginV2IOExt` or `IPluginV2DynamicExt`
13+
- Use the new `Logger` class defined in logging.h

yolov4/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ cuda_add_library(myplugins SHARED ${PROJECT_SOURCE_DIR}/yololayer.cu ${PROJECT_S
3131
find_package(OpenCV)
3232
include_directories(OpenCV_INCLUDE_DIRS)
3333

34-
add_executable(yolov4 ${PROJECT_SOURCE_DIR}/plugin_factory.cpp ${PROJECT_SOURCE_DIR}/yolov4.cpp)
35-
target_link_libraries(yolov4 nvinfer nvinfer_plugin)
34+
add_executable(yolov4 ${PROJECT_SOURCE_DIR}/yolov4.cpp)
35+
target_link_libraries(yolov4 nvinfer)
3636
target_link_libraries(yolov4 cudart)
3737
target_link_libraries(yolov4 myplugins)
3838
target_link_libraries(yolov4 ${OpenCV_LIBS})

0 commit comments

Comments
 (0)