Skip to content

Commit

Permalink
fix: tensorrt output layer lookup now throws when layer does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
beniz authored and sileht committed Nov 9, 2020
1 parent 9edf1d4 commit ba7c839
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/backends/tensorrt/tensorrtlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ namespace dd
throw MLLibInternalException("Error while parsing caffe model "
"for conversion to TensorRT");

network->markOutput(*blobNameToTensor->find(out_blob.c_str()));
auto bloboutput = blobNameToTensor->find(out_blob.c_str());
if (!bloboutput)
throw MLLibBadParamException("Cannot find output layer " + out_blob);
network->markOutput(*bloboutput);

if (out_blob == "detection_out")
network->markOutput(*blobNameToTensor->find("keep_count"));
Expand Down

0 comments on commit ba7c839

Please sign in to comment.