Skip to content

Commit

Permalink
check if trt_engine invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
yf711 committed Jul 30, 2024
1 parent 0d7cf30 commit 0f6efdc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3672,6 +3672,10 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView
return ORT_MAKE_STATUS(ONNXRUNTIME, EP_FAIL, "TensorRT EP Failed to Build Engine.");
}
trt_engine = trt_state->engine->get();
// Check before using trt_engine
if (trt_engine == nullptr) {
return ORT_MAKE_STATUS(ONNXRUNTIME, EP_FAIL, "Invalid TensorRT engine, please rebuild.");
}
if (trt_state->engine_cache_enable) {
// Serialize engine profile
SerializeProfileV2(profile_cache_path, shape_ranges);
Expand Down

0 comments on commit 0f6efdc

Please sign in to comment.