Giter Club home page Giter Club logo

tensorrt-yolov4's Introduction

TensorRT-YOLOv4

demo

image image

Performance

model input_size GPU mode inference Time
yolov4 608x608 gtx 1080Ti float32 23.3 ms
yolov4 416x416 gtx 1080Ti float32 13.0 ms
yolov3 608x608 gtx 1080Ti float32 18.2 ms
yolov3 416x416 gtx 1080Ti float32 10.0 ms
yolov3-tiny 608x608 gtx 1080Ti float32 3.31 ms
yolov3-tiny 416x416 gtx 1080Ti float32 2.01 ms
yolov3-tiny-prn 608x608 gtx 1080Ti float32 3.05 ms
yolov3-tiny-prn 416x416 gtx 1080Ti float32 2.01 ms
  1. Including pre-processing and post-processing time.

Enviroments

  1. gtx 1080Ti
ubuntu 1604
TensorRT 5.0
cuda 9.0
python3 onnx=1.4.1 

Models

  1. Add (infer_thresh) and (down_stride) to your .cfg.
[yolo]  ## small anchor
mask = 0,1,2
anchors = ...
down_stride = 8
infer_thresh = 0.5  
...
[yolo] ## mid anchor
mask = 3,4,5
anchors = ...
down_stride = 16
infer_thresh = 0.5
...
[yolo] ## big anchor
mask = 6,7,8
anchors = .....
down_stride = 32
infer_thresh = 0.5
  1. Convert darknet yolo to onnx.
python3 tools/yolo_to_onnx.py --cfg model/yolov4.cfg --weights model/yolov4.weights --out model/yolov4.onnx

Example

git clone https://github.com/CaoWGG/TensorRT-YOLOv4.git
cd TensorRT-YOLOv4
mkdir build
cd build && cmake .. && make
cd ..
## yolov3
./buildEngine -i model/yolov3.onnx -o model/yolov3.engine -b 1 -m 0
./runDet -i model/yolov3.engine -p dog.jpg -v nuscenes_mini.mp4
## yolov4
./buildEngine -i model/yolov4.onnx -o model/yolov4.engine -b 1 -m 0
./runDet -i model/yolov4.engine -p dog.jpg -v nuscenes_mini.mp4

Related projects

tensorrt-yolov4's People

Contributors

caowgg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorrt-yolov4's Issues

CMake error missing OpenCV includes

Hi,

I don't know if I am right, but while attemting to build with CMake the repository, CMake output an error of missing the includes of OpenCV. Supposedly this is in the folder:

TensorRT-YOLOv4/src/CMakeLists.txt

I changed the CMakeLists.txt to sth like this:

cmake_minimum_required(VERSION 3.5)
project(trt LANGUAGES CXX )
find_package(CUDA REQUIRED)
find_package( OpenCV REQUIRED )
find_path(TENSORRT_INCLUDE_DIR NvInfer.h
        HINTS ${TENSORRT_ROOT} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES include)
find_library(TENSORRT_INFER libnvinfer.so
        HINTS ${TENSORRT_ROOT} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES lib lib64 lib/x64)
find_library(TENSORRT_INFER_PLUGIN libnvinfer_plugin.so
        HINTS ${TENSORRT_ROOT} ${CUDA_TOOLKIT_ROOT_DIR}
        PATH_SUFFIXES lib lib64 lib/x64)
include_directories(
        ./
        ../include
        ../onnx-tensorrt
        ${TENSORRT_INCLUDE_DIR}
        ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
	${OpenCV_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Ofast ")
set(CUDA_NVCC_FLAGS  "-D_FORCE_INLINES -Xcompiler -fPIC -gencode arch=compute_${GPU_ARCHS},code=sm_${GPU_ARCHS} -gencode arch=compute_${GPU_ARCHS},code=compute_${GPU_ARCHS}")
set(SRC_LIST resize.cu trt.cpp)
cuda_add_library(trt SHARED ${SRC_LIST})
target_link_libraries(trt ${TENSORRT_INFER_PLUGIN} ${TENSORRT_INFER} ${OpenCV_LIBS} mynvonnxparser mynvonnxparser_runtime)

Adding these three lines:

find_package( OpenCV REQUIRED )
${OpenCV_INCLUDE_DIRS}
${OpenCV_LIBS} 

It worked and output the .onnx file. Am I missing sth? Should I pull a request to correct it?

#include <driver_types.h>

在運行到第二步(cd build && cmake .. && make)時候出現
/usr/include/cudnn.h:64:10: fatal error: driver_types.h: 没有那个文件或目录
#include <driver_types.h>

失败:尝试在TensorRT-YOLOv4/onnx-tensorrt/下生成onnx2trt可执行文件进行转换

转换到.onnx成功,但生成.engine失败,运行如下:

$./buildEngine -i model/yolov4.onnx -o model/yolov4.engine -b 1 -m 0
input-onnx: model/yolov4.onnx
output-engine: model/yolov4.engine
max-batchsize: 1
calib-file: 
----------------------------------------------------------------
Input filename:   model/yolov4.onnx
ONNX IR version:  0.0.4
Opset version:    9
Producer name:    https://github.com/CaoWGG
Producer version: 
Domain:           
Model version:    0
Doc string:       
----------------------------------------------------------------
Begin building engine...
End building engine...
Killed

以下是我的jetson nano配置:
JetPack4.4; cuDNN 8.0; CUDA 10.2; OpenCV 4.1.1; Visionworks 1.6; python3 3.6.9; TensorRT 7.1.3.4

随后我尝试生成.trt文件: 在TensorRT-YOLOv4/onnx-tensorrt/目录下

mkdir build
cd build
cmake .. -DTENSORRT_ROOT=/opt/tensorrt -DGPU_ARCHS="53"
make 
sudo make install

但是没有发现生成onnx2trt的可执行文件。

退出过程中,内存释放报错

大神,你好!
我的环境是:
trt 5.1.5
cuda10
cudnn 7.5.0
ubuntu 16
运行后,按esc退出后,报错如下:


*** Error in `./runDet': free(): invalid pointer: 0x00000000025865e0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fa872c937e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fa872c9c37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fa872ca053c]
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9(_ZN6google8protobuf8internal28DestroyDefaultRepeatedFieldsEv+0x1f)[0x7fa84a7348af]
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9(_ZN6google8protobuf23ShutdownProtobufLibraryEv+0x8b)[0x7fa84a733b3b]
/usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3(+0x233b9)[0x7fa83e7fd3b9]
/lib64/ld-linux-x86-64.so.2(+0x10df7)[0x7fa875853df7]
/lib/x86_64-linux-gnu/libc.so.6(+0x39ff8)[0x7fa872c55ff8]
/lib/x86_64-linux-gnu/libc.so.6(+0x3a045)[0x7fa872c56045]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0x7fa872c3c837]
./runDet[0x4061f9]
======= Memory map: ========

用gdb跟进去,没有看出是哪里的问题,请大神帮忙看看
祝好!

编译错误

错误:
../../lib/libtrt.so:对‘cv::String::deallocate()’未定义的引用
collect2: error: ld returned 1 exit status
example/CMakeFiles/runDet.dir/build.make:121: recipe for target '../runDet' failed
make[2]: *** [../runDet] Error 1
CMakeFiles/Makefile2:537: recipe for target 'example/CMakeFiles/runDet.dir/all' failed
make[1]: *** [example/CMakeFiles/runDet.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

请问这个错误有办法修复吗?

在coco上测试mAP相差0.9

你好,测试了AlexeyAB/darknet提供的yolov4.weight,与tensorRT转换后的fp32版,(已更改bgr2rgb与keepration=0,keepcenter=0),在coco val2017上相差0.9个点,请问还有什么可能的原因吗

refine了框超出边界的情况后,相差0.6个点

关于onnx生成engine的问题

大佬您好,我在生成engine的时候注意到opset version的问题。在ubuntu和您相同的环境下生成engine时opset version是12,我在windows下生成engine时则是0。在代码中我注意到:
ModelImporter.cpp line 239:
int64_t opset_version = (onnx_model.opset_import().size() ? onnx_model.opset_import(0).version() : 0);
根据这一句,我是否可以确定此时onnx_model.opset_import().size() 为0?若确实如此,这将对engine生成产生什么影响?
感谢大佬!

大佬 编译报错 能帮忙看看么

-- ******** Summary ********
-- CMake version : 3.5.1
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 5.4.0
-- CXX flags : -Wall -Wnon-virtual-dtor
-- Build type : Relaese
-- Compile definitions : ONNX_NAMESPACE=onnx2trt_onnx
-- CMAKE_PREFIX_PATH :
-- CMAKE_INSTALL_PREFIX : /usr/local
-- CMAKE_MODULE_PATH :

-- ONNX version : 1.3.0
-- ONNX NAMESPACE : onnx2trt_onnx
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_USE_LITE_PROTO : OFF
-- ONNXIFI_DUMMY_BACKEND : OFF

-- Protobuf compiler : /usr/bin/protoc
-- Protobuf includes : /usr/include
-- Protobuf libraries : optimized;/usr/lib/x86_64-linux-gnu/libprotobuf.so;debug;/usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread
-- BUILD_ONNX_PYTHON : OFF
-- GPU_ARCH defined as 61. Generating CUDA code for SM 61
-- Found TensorRT headers at /home/syq/桌面/tensorrt/TensorRT-6.0.1.5/include
-- Find TensorRT libs at /home/syq/桌面/tensorrt/TensorRT-6.0.1.5/lib/libnvinfer.so;/home/syq/桌面/tensorrt/TensorRT-6.0.1.5/lib/libnvinfer_plugin.so
-- opencv_videostabopencv_stitchingopencv_imgprocopencv_dnnopencv_photoopencv_objdetectopencv_superresopencv_shapeopencv_features2dopencv_flannopencv_highguiopencv_mlopencv_videoopencv_calib3dopencv_videoioopencv_coreopencv_imgcodecs
-- Configuring done
-- Generating done
-- Build files have been written to: /media/syq/02b4658b-1674-416a-9688-19e3795b42fa/syq/TensorRT-YOLOv4-master/build
[ 28%] Built target mynvonnxparser_plugin
[ 34%] Built target gen_onnx_proto
[ 52%] Built target onnx_proto
make[2]: *** No rule to make target '/usr/local/cuda-10.0/lib64/libcudnn.so', needed by '../lib/libmynvonnxparser.so'。 停止。
CMakeFiles/Makefile2:129: recipe for target 'onnx-tensorrt/CMakeFiles/mynvonnxparser.dir/all' failed
make[1]: *** [onnx-tensorrt/CMakeFiles/mynvonnxparser.dir/all] Error 2
Makefile:127: recipe for target 'all' failed

down_stride add to .cfg

Hi, thank for this awesome project.
I have a question about cfg file, down_stride what dose it mean?

does engine.inputDim.nbDims ==3 mean that it only can take input of batch size 1?

I am trying to build an engine with batchsize to be 4
./buildEngine -i model/yolov4_b4.onnx -o model/yolov4_b4.engine -b 4 -m 0
the inputDim.nbDims is still 3, if it can take input of batch size > 1, will the inputDim.nbDims have to be 4....?
if not, how can i wrap more than one color images to create input with dim 3 for the yolov4 engine?

如何加载两个模型在trt engine 在一个gpu上进行推断

請問您有测试过加载两个模型在trt engine 在一个gpu上进行推断吗?

目前依照您的代码, 加载单个engine是没问题的

如果只加载一次模型, 进行第二路推断, 第二路推断的结果就会异常, 例如box框乱跳, 无法正常推断, 但是第一路是没问题的
如果我加载两个同样的模型到两个变量, 一样第一个运行没问题, 但是第二路推断会检测不到东西

不晓得您有类似经验没有 谢谢 !

关于No plugin registered for op

您好

近期测试您的项目是没问题的,

但是将项目下编译好的库文件 libmynvonnx...etc 拉到我自己的项目下

并且另外写了个inference函数(均模仿runDet的写法), 在调用这个函数的时候

会出现No plugin registered for op : FancyActivation
还有No plugin registered for op : Yolo 这些

是不是不能直接这样移植编译好的库文件?

buildEngine Error

Setting the option to "-m 2"(int8) causes the following error.

Calibration failure occurred with no scaling factors detected. This could be due to no int8 calibrator or insufficient custom scales for network layers. Please see int8 sample to setup calibration correctly.

Why does this error occur?
Thank you.

转yolov4-tiny失败

您好,我修改好了yolov4-tiny的cfg文件,但在转换yolov4-tiny为onnx时失败了,cfg文件如下:
[net]

Testing

#batch=1
#subdivisions=1

Training

batch=64
subdivisions=1
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.00261
burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1

[convolutional]
batch_normalize=1
filters=32
size=3
stride=2
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=2
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[route]
layers=-1
groups=2
group_id=1

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[route]
layers = -1,-2

[convolutional]
batch_normalize=1
filters=64
size=1
stride=1
pad=1
activation=leaky

[route]
layers = -6,-1

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[route]
layers=-1
groups=2
group_id=1

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[route]
layers = -1,-2

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[route]
layers = -6,-1

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[route]
layers=-1
groups=2
group_id=1

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[route]
layers = -1,-2

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[route]
layers = -6,-1

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

##################################

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear

[yolo]
mask = 3,4,5
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=80
down_stride = 32
infer_thresh = 0.25
num=6
jitter=.3
scale_x_y = 1.05
cls_normalizer=1.0
iou_normalizer=0.07
iou_loss=ciou
ignore_thresh = .7
truth_thresh = 1
random=0
resize=1.5
nms_kind=greedynms
beta_nms=0.6

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 23

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear

[yolo]
mask = 1,2,3
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=80
down_stride = 16
infer_thresh = 0.25
num=6
jitter=.3
scale_x_y = 1.05
cls_normalizer=1.0
iou_normalizer=0.07
iou_loss=ciou
ignore_thresh = .7
truth_thresh = 1
random=0
resize=1.5
nms_kind=greedynms
beta_nms=0.6

报错如下:
Traceback (most recent call last):
File "tools/yolo_to_onnx.py", line 748, in
main()
File "tools/yolo_to_onnx.py", line 743, in main
verbose=True)
File "tools/yolo_to_onnx.py", line 345, in build_onnx_graph
conv_params)
File "tools/yolo_to_onnx.py", line 219, in load_conv_weights
conv_params, 'conv', 'weights')
File "tools/yolo_to_onnx.py", line 248, in _create_param_tensors
conv_params, param_category, suffix)
File "tools/yolo_to_onnx.py", line 280, in _load_one_param_type
buffer=self.weights_file.read(param_size * 4))
TypeError: buffer is too small for requested array

我也安装yolov3-tiny的样式把cfg的第二个yolo层的mask改为0,1,2,down_stride的大小也上下替换过,但都报错,请问这个是需要怎么修改??

mContext->execute 报错

我用的是jetson nano 自带Tensorrt 6.0 cuda 10.0
按照您的步骤运行到此步骤 ./runDet -i model/yolov3.engine -p dog.jpg -v nuscenes_mini.mp4
报错信息为:terminate called after throwing an instance of 'thrust::system::system_error'
what(): parallel_for failed: no kernel image is available for execution on the device
报错的位置在 trt.cpp : mContext->execute(1,&mCudaBuffers[0]);
大概查了一下,大概是cuda版本问题。
想知道的是这个程序,如何可以在我这个环境下运行,在不更改cuda和tensorrt版本的情况下
还有个疑问:
在TensotRT-YOLOv4目录下的CMakeLists.txt文件中,
set(GPU_ARCHS 62)
set(TENSORRT_ROOT /usr/local/TensorRT-5.0.2.6)
这两句起到什么作用。

期待您的解答与交流。感谢

Batch inference support

How do we extend the inference function to support batchSize > 1? For batched inputs, I'm using OpenCV's blobFromImages. It seems to work just fine as batchSize = 1 (using model/weights with maxBatchSize of 2). But how do I parse the output? How do I get to the subsequent batchId?

Thanks.

onnx转换模型问题,请大大回答下(2 cls 出现问题)

batch,height,width =dim[0].dim_value,dim[2].dim_value//down_stride,dim[3].dim_value//down_stride
output_dims = [batchheightwidth*anhor_num + 1,6]**
请问这里的output_dims 为什么要+1 , 同时这里…6是什么意思(x , y , w , h , conf , cls ?)?
我用darknet训练的2类 , 发现一些问题 , Infer时侯 , 发现类别错乱,场景复杂时侯,请问什么问题?

在windows编译时报错

CMake Error at D:/Program Files/CMake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR)
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
D:/Program Files/CMake/share/cmake-3.16/Modules/FindProtobuf.cmake:624 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
onnx-tensorrt/CMakeLists.txt:114 (FIND_PACKAGE)

yolov3-tiny float16

您好,我用自己数据集训练得到的yolov3-tiny做加速,float32位精度可以转成功,但是转float16时报错,
WARNING: Half2 support requested on hardware without native FP16 support, performance will be negatively affected.
ERROR: ../builder/cudnnBuilderWeightConverters.cpp (310) - Misc Error in transformWeightsIfFP: 1 (Weights are outside of fp16 range. A possible fix is to retrain the model with regularization to bring the magnitude of the weights down.)
这是什么原因呢?
运行的代码为:
./buildEngine -i model/yolov3-tiny-highway-704.onnx -o model/yolov3-tiny-hoghway-704-fp16.engine -b 1 -m 1

KeyError: 'stride'

Hi Sir

run yolo_to_onnx.py

Traceback (most recent call last):
  File "yolo_to_onnx.py", line 746, in <module>
    main()
  File "yolo_to_onnx.py", line 741, in main
    verbose=True)
  File "yolo_to_onnx.py", line 324, in build_onnx_graph
    major_node_specs = self._make_onnx_node(layer_name, layer_dict)
  File "yolo_to_onnx.py", line 397, in _make_onnx_node
    node_creators[layer_type](layer_name, layer_dict)
  File "yolo_to_onnx.py", line 454, in _make_conv_node
    stride = layer_dict['stride']
KeyError: 'stride'

why ? Thanks so much !

‘createConcatPlugin’ is not a member of ‘nvinfer1::plugin’

@CaoWGG

thank you for your repo.
I can run it on PC with rtx2070 and the performance is very good.
but I try to build it on Jetson NX with tensorRT 7.1 cuda 10.2
meet below issue.It seems new tensorRT version drop " createConcatPlugin"
Do you have any idea to fixed it?
##========================================================================
/home/ashing/TensorRT-YOLOv4/onnx-tensorrt/builtin_plugins.cpp: In function ‘onnx2trt::Plugin* onnx2trt::{anonymous}::_build_ConcatPlugin(const void*, size_t)’:
/home/ashing/TensorRT-YOLOv4/onnx-tensorrt/builtin_plugins.cpp:70:27: error: ‘createConcatPlugin’ is not a member of ‘nvinfer1::plugin’
nvinfer1::plugin::create##PluginClass(serialData, serialLength));
^
/home/ashing/TensorRT-YOLOv4/onnx-tensorrt/builtin_plugins.cpp:70:27: note: in definition of macro ‘REGISTER_BUILTIN_NVPLUGIN’
nvinfer1::plugin::create##PluginClass(serialData, serialLength));
^~~~~~
onnx-tensorrt/CMakeFiles/mynvonnxparser_runtime.dir/build.make:110: recipe for target 'onnx-tensorrt/CMakeFiles/mynvonnxparser_runtime.dir/builtin_plugins.cpp.o' failed

no box in the result

hello,I have a question,I run the project as your steps,there is no error,but there is no box in the result image and mp4.Is there any suggestion? Thank you

make error

您好,我用的是tensorRT7.0版本,make的时候出现了这个问题,请问这个问题是啥?是tensorRT版本问题吗?
Screenshot from 2020-05-26 16-50-55

cv::String::deallocate()

../../lib/libtrt.so:对‘cv::String::deallocate()’未定义的引用
collect2: error: ld returned 1 exit status
example/CMakeFiles/buildEngine.dir/build.make:161: recipe for target '../buildEngine' failed

python 不能调用转换好的engine文件

大佬您好,我在python调用转换好的engine文件时报错:
代码:
with open(engine_file_path, "rb") as f, trt.Runtime(TRT_LOGGER) as runtime:
init_engine = runtime.deserialize_cuda_engine(f.read())
engine_file_path是对的,但这里init_enfine一直为None
请问要怎么才能调用?

输出的框 变长

77E07F8E-D5D0-46D9-A92B-4B43E668AD5A

大概像是图上那样,用的是yolov4
cfg 中的input 是608

在darknet上做infer是正常没问题的,加速后就拉长了

Core dumped : cudaErrorNoKernelImageForDevice

I am getting core dumped error while executing ' ./runDet -i model/yolov4.engine -p dog.jpg -v nuscenes_mini.mp4 '

The error is as follows:

input-engine: model/yolov4.engine
image: dog.jpg
video: nuscenes_mini.mp4
terminate called after throwing an instance of 'thrust::system::system_error'
what(): parallel_for failed: cudaErrorNoKernelImageForDevice: no kernel image is available for execution on the device
Aborted (core dumped)

I am using CUDA 10.1, tensort 5 and nvdia geforce 940m,

Is Geforce 940m not compatible with tensorrt ?

转onnx时报错

您好,我在使用自己训练模型转onnx时,报错:
Traceback (most recent call last):
File "tools/yolo_to_onnx.py", line 748, in
main()
File "tools/yolo_to_onnx.py", line 743, in main
verbose=True)
File "tools/yolo_to_onnx.py", line 345, in build_onnx_graph
conv_params)
File "tools/yolo_to_onnx.py", line 219, in load_conv_weights
conv_params, 'conv', 'weights')
File "tools/yolo_to_onnx.py", line 248, in _create_param_tensors
conv_params, param_category, suffix)
File "tools/yolo_to_onnx.py", line 280, in _load_one_param_type
buffer=self.weights_file.read(param_size * 4))
TypeError: buffer is too small for requested array

我看网络结构完全没问题,可以导入预训练模型进行迁移学习,cfg文件只修改了classes,其它没有改变,请问是哪里出了问题?? 我用官网预训练模型转的时候也没有问题

GPU算力占用,多Batch

代码跑起来速度很快,很赞。
但是GPU算力占用100%,
代码风格很好,但是能不能教一下多Batch代码应该怎么改
哈哈,不是不想改,是改了,改得面目全非

cuda10.0+cudnn7.6.3+TensorRT-6.0.1.5

能编译通过,测试下来结果如下:
input-engine: model/yolov4.engine
image: dog.jpg
video: nuscenes_mini.mp4
cost: 382 ms
cost: 206.5 ms
cost: 148 ms
cost: 118.75 ms
cost: 101.4 ms
cost: 89.3333 ms
cost: 81 ms
cost: 74.5 ms
cost: 69.6667 ms
cost: 67.2 ms
cost: 63.7273 ms
cost: 60.8333 ms
cost: 58.3846 ms
cost: 56.2857 ms
cost: 54.4667 ms
cost: 52.875 ms
cost: 51.4706 ms
cost: 50.2222 ms
cost: 49.1053 ms
cost: 48.1 ms
cost: 47.1905 ms
cost: 46.3636 ms
cost: 45.6087 ms
cost: 44.9167 ms
cost: 44.28 ms
cost: 43.6923 ms
cost: 43.1481 ms
cost: 42.6429 ms
cost: 42.1724 ms
cost: 41.7333 ms
cost: 41.3226 ms
cost: 41.1875 ms
cost: 40.8182 ms
cost: 40.5588 ms
cost: 40.2857 ms
cost: 40 ms
cost: 39.7297 ms
cost: 39.5 ms
cost: 39.2308 ms
cost: 39 ms
cost: 38.7561 ms

感觉cuda9.0测试下来结果都在29ms左右,请问是什么原因呢?莫非源代码和cuda9.0绑定了?感谢

nano上buildEngine报错

您好,我用的是jetson nano 自带Tensorrt 6.0 cuda 10.0
按照步骤运行 ./buildEngine时
报错信息为:terminate called after throwing an instance of 'thrust::system::system_error'
what(): parallel_for failed: no kernel image is available for execution on the device
请问是否有解决方案,谢谢

TensorRT 7 support

Is there a plan that your TensorRT series projects upgrade to support TensorRT 7 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.