Skip to content

Commit

Permalink
squeezenet to trt 7
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-xinyu committed Nov 9, 2020
1 parent 18fa419 commit 983fba2
Show file tree
Hide file tree
Showing 5 changed files with 554 additions and 398 deletions.
9 changes: 7 additions & 2 deletions squeezenet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)

include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(/usr/local/cuda-9.0/targets/aarch64-linux/include)
link_directories(/usr/local/cuda-9.0/targets/aarch64-linux/lib)
# include and link dirs of cuda and tensorrt, you need adapt them if yours are different
# cuda
include_directories(/usr/local/cuda/include)
link_directories(/usr/local/cuda/lib64)
# tensorrt
include_directories(/usr/include/x86_64-linux-gnu/)
link_directories(/usr/lib/x86_64-linux-gnu/)

add_executable(squeezenet ${PROJECT_SOURCE_DIR}/squeezenet.cpp)
target_link_libraries(squeezenet nvinfer)
Expand Down
6 changes: 0 additions & 6 deletions squeezenet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters

For the Pytorch implementation, you can refer to [pytorchx/squeezenet](https://github.com/wang-xinyu/pytorchx/tree/master/squeezenet)

Following tricks are used in this squeezenet,

- MaxPool2d(ceil_mode=True), ceilmode=True, which is not supported in Tensorrt4, we use a padding layer before maxpool to solve this problem.
- For Pytorch AdaptiveAvgPool2d(), we use fixed input dimension, and use regular average pooling to replace it.

```
// 1. generate squeezenet.wts from [pytorchx/squeezenet](https://github.com/wang-xinyu/pytorchx/tree/master/squeezenet)
Expand All @@ -36,4 +31,3 @@ sudo ./squeezenet -d // deserialize plan file and run inference
// 4. see if the output is same as pytorchx/squeezenet
```


356 changes: 0 additions & 356 deletions squeezenet/common.h

This file was deleted.

Loading

0 comments on commit 983fba2

Please sign in to comment.