File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
paddle/fluid/operators/tensorrt Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,24 @@ class TensorRTEngineOp : public framework::OperatorBase {
269
269
output_index += 1 ;
270
270
}
271
271
272
- PADDLE_ENFORCE_LE (runtime_batch, max_batch_size_);
272
+ PADDLE_ENFORCE_LE (
273
+ runtime_batch, max_batch_size_,
274
+ platform::errors::InvalidArgument (
275
+ " The runtime batch size (%d) is greater than the max batch "
276
+ " size(%d).\n "
277
+ " There are two possible causes for this problem: \n "
278
+ " 1. Check whether the runtime batch is larger than the max_batch "
279
+ " setted by EnableTensorrtEngine()\n "
280
+ " 2. Check whether the model you are running has multiple trt "
281
+ " subgraphs: \n "
282
+ " \t If there are multiple trt subgraphs, you need to ensure that "
283
+ " the first dimension of the input tensor of these subgraphs is "
284
+ " consistent.\n "
285
+ " \t If there are inconsistent subgraphs, you need to filter them by "
286
+ " setting min_subgraph_size using EnableTensorrtEngine interface.\n "
287
+ " \t The min_subgraph_size shouble to be greater than the number of "
288
+ " nodes in the inconsistent subgraph.\n " ,
289
+ runtime_batch, max_batch_size_));
273
290
// Execute the engine.
274
291
engine->Execute (runtime_batch, &buffers, stream);
275
292
cudaStreamSynchronize (stream);
You can’t perform that action at this time.
0 commit comments