Closed wulixunhua closed 4 years ago
You should confirm your model can run correct in Tensorrt. Maybe you can try pre-trained model.
@DanaHan Yes, I use the "tensorrtx" model directly and I have confirmed the model can run correct in tensorrt. But I run the engine on deepstream ,the the coordinates of boxes all zero.
@wulixunhua I just test yolov5s model in fp16. Once a time, I also get NAN or zero output. Because the output layer.buffer is only a pointer, so convert need to be done. In my test, unsigned int is correct in my model.
@DanaHan I print the last feature map as follow:
static bool NvDsInferParseYoloV5( std::vector<NvDsInferLayerInfo> const& outputLayersInfo,
NvDsInferNetworkInfo const& networkInfo,
NvDsInferParseDetectionParams const& detectionParams,
std::vector<NvDsInferParseObjectInfo>& objectList)
{
float *layer = (float *)outputLayersInfo[0].buffer;
for(int i=0; i<30; i++)
std::cout << layer[i] << " ";
std::cout << std::endl;
...
...
}
The results are "8303 nan nan nan nan nan 0 nan nan nan nan nan 0 nan nan nan nan nan 0 nan ...."
Then I modify float to unsigned int, but get also zero coordinates and huge numbers of last feature map. Can you provide your specific steps? Thank you.
This repos only suitable for engine model convert from https://github.com/wang-xinyu/tensorrtx. If you get engine file follow as ONNX->Engine. The parse maybe different.
@DanaHan I converted engine model from tensorrtx, but got the same result with @wulixunhua
Sorry, I forget an important step in readme. You should replace yololayer.cu and hardswish.cu to tensrortx/yolov5. And then generate engine model.
And please report whether this step can correct your problem.
@DanaHan Sorry, I didn't get the point. What should I replace with for yololayer.cu and hardswish.cu?
@DanaHan Sorry, I didn't get the point. What should I replace with for yololayer.cu and hardswish.cu?
Just find yololayer.cu and hardswish.cu in tensrortx/yolov5 and delete . Then put my modified file to tensrortx/yolov5.
@DanaHan Sorry, I didn't get the point. What should I replace with for yololayer.cu and hardswish.cu?
Just find yololayer.cu and hardswish.cu in tensrortx/yolov5 and delete . Then put my modified file to tensrortx/yolov5.
Got it, thanks, I will try
@DanaHan I put your modified file yololayer.cu and hardswish.cu to test ,the results right. Thank you.
Hi, I run
export LD_PRE_LOAD = ./libmyplugins.so
deepstream-app -c deepstream_app_config_yoloV5.txt
I print the coordinates of boxes , all zero. I print the feature map , all "nan". (I test the yolov5s.engine , the feature map is right.) How reasons?