wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
6.89k stars 1.76k forks source link

精度在 INT8 下, 执行 ./yolov5 -s 不成功 #411

Closed lusi1990 closed 3 years ago

lusi1990 commented 3 years ago

CUDA: 10.2 CUDNN: 8.0.5 tensorRT: 7.2.2.3 OS: Ubuntu 18.04

yolov5 的版本是 4.0

cmake 输出

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDA: /usr/local/cuda (found version "10.2") 
-- Found OpenCV: /usr/local (found version "4.5.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/l/tensorrtx/yolov5/build

make 输出

[ 20%] Building NVCC (Device) object CMakeFiles/myplugins.dir/myplugins_generated_yololayer.cu.o
/home/l/tensorrtx/yolov5/yololayer.h(85): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims *, int32_t, const nvinfer1::Dims *, int32_t, const nvinfer1::DataType *, const nvinfer1::DataType *, const __nv_bool *, const __nv_bool *, nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::YoloLayerPlugin::configurePlugin" -- virtual function override intended?

/home/l/tensorrtx/yolov5/yololayer.h(85): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims *, int32_t, const nvinfer1::Dims *, int32_t, const nvinfer1::DataType *, const nvinfer1::DataType *, const bool *, const bool *, nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::YoloLayerPlugin::configurePlugin" -- virtual function override intended?

Scanning dependencies of target myplugins
[ 40%] Linking CXX shared library libmyplugins.so
[ 40%] Built target myplugins
Scanning dependencies of target yolov5
[ 60%] Building CXX object CMakeFiles/yolov5.dir/calibrator.cpp.o
[ 80%] Building CXX object CMakeFiles/yolov5.dir/yolov5.cpp.o
[100%] Linking CXX executable yolov5
[100%] Built target yolov5

./yolov5 -s

Loading weights: ../yolov5x.wts
Your platform support int8: true
Building engine, please wait for a while...
reading calib cache: int8calib.table
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Aborted (core dumped)

FP32 和 FP16 都能成功执行并且推断. opencv 是自己编译安装的. 版本是最新的

wang-xinyu commented 3 years ago

Hi, 再仔细看下readme中int8的说明,需要准备calibration data

lusi1990 commented 3 years ago

Hi, 再仔细看下readme中int8的说明,需要准备calibration data

感谢, 已经解决了

henbucuoshanghai commented 3 years ago

你好 是哪里有问题呢?

henbucuoshanghai commented 3 years ago

make [ 20%] Building NVCC (Device) object CMakeFiles/myplugins.dir/myplugins_generated_yololayer.cu.o tensorrtx/yolov4/yololayer.h(105): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims , int32_t, const nvinfer1::Dims , int32_t, const nvinfer1::DataType , const nvinfer1::DataType , const __nv_bool , const __nv_bool , nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::YoloLayerPlugin::configurePlugin" -- virtual function override intended?

/tensorrtx/yolov4/yololayer.h(105): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims , int32_t, const nvinfer1::Dims , int32_t, const nvinfer1::DataType , const nvinfer1::DataType , const bool , const bool , nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::YoloLayerPlugin::configurePlugin" -- virtual function override intended?

[ 40%] Building NVCC (Device) object CMakeFiles/myplugins.dir/myplugins_generated_mish.cu.o tensorrtx/yolov4/mish.h(62): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims , int32_t, const nvinfer1::Dims ,/home/keyvalue int32_t, const nvinfer1::DataType , const nvinfer1::DataType , const __nv_bool , const __nv_bool , nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::MishPlugin::configurePlugin" -- virtual function override intended?

tensorrtx/yolov4/mish.h(62): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims , int32_t, const nvinfer1::Dims , int32_t, const nvinfer1::DataType , const nvinfer1::DataType , const bool , const bool , nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::MishPlugin::configurePlugin" -- virtual function override intended?

Scanning dependencies of target myplugins [ 60%] Linking CXX shared library libmyplugins.so [ 60%] Built target myplugins Scanning dependencies of target yolov4 [ 80%] Building CXX object CMakeFiles/yolov4.dir/yolov4.cpp.o [100%] Linking CXX executable yolov4 [100%] Built target yolov4 Then /tensorrtx/yolov4/build# ./yolov4 -s Loading weights: ../yolov4.wts CUDA error 222 at /tensorrtx/yolov4/yololayer.cu:19yolov4: /tensorrtx/yolov4/yololayer.cu:19: nvinfer1::YoloLayerPlugin::YoloLayerPlugin(): Assertion `0' failed. Aborted (core dumped)

Today-99 commented 2 years ago

Hi, 再仔细看下readme中int8的说明,需要准备calibration data

感谢, 已经解决了

感谢,感谢