I have a tensorflow saved model that I am attempting to host in the TensorRT inference server.
Several if the inputs and outputs are variable size. Since it is a tensorflow saved model, I attemped to use the --strict-model-config=false flag to automatically generate the config. It generated this: (note I have changed the input/oyutput names to obfuscate the purpose of the model) where it replaced the variable dimensions with -1:
As you can see with the model state above, it couldn’t determine on all the input and output dimensions.
So I created a config.pbtxt with the dimensions of the input and output layers carefully constructed.
I tried this with tensorRT Inference Server and I am getting his error:
I0313 15:01:01.556557 1 loader.cc:298] SavedModel load for tags { serve }; Status: success. Took 273490 microseconds.
E0313 15:01:01.573928 1 retrier.cc:37] Loading servable: {name: test version: 44} failed: Invalid argument: unable to load model ‘test’, output ‘output1’ dims [-1] don’t match configuration dims [-1]
I0313 15:01:01.573977 1 loader_harness.cc:154] Encountered an error for servable version {name:test version: 44}: Invalid argument: unable to load model ‘test’, output ‘output1’ dims [-1] don’t match configuration dims [-1]
If you look at the error, the for “output1” the config.pbtxt says the dimensions for output1 are -1, and the the configuration are -1, but they don’t match. Huh? What is going on here?
Thanks. Just in case, I am coming to GTC next week and will bring my model with me to ask the experts sessions . (TensorRT and TensorRT Inference server.)
"For models that support input and output tensors with variable-size dimensions, those dimensions can be listed as -1 in the input and output configuration. For example, if a model requires a 2-dimensional input tensor where the first dimension must be size 4 but the second dimension can be any size, the model configuration for that input would include dims: [ 4, -1 ]. The inference server would then accept inference requests where that input tensor’s second dimension was any value >= 1. "
I still need help with the this TRTIS error:
E0313 15:01:01.573928 1 retrier.cc:37] Loading servable: {name: test version: 44} failed: Invalid argument: unable to load model ‘test’, output ‘output1’ dims [-1] don’t match configuration dims [-1]
I0313 15:01:01.573977 1 loader_harness.cc:154] Encountered an error for servable version {name:test version: 44}: Invalid argument: unable to load model ‘test’, output ‘output1’ dims [-1] don’t match configuration dims [-1]
per engineering: Notice that in the configuration output1 has no dimension. That means its shape is completely determined by the batch-size. In tensorflow terminology the shape for this tensor would be [ ? ], where the ? represents the batch-size.
As of 19.03 TRTIS does not support this type of tensor (that is, tensors that have no shape except for the batch dimension). We are fixing this issue for a future TRTIS version.
Sorry to necro, but I’m encountering a similar issue on TRTIS 19.03 (build 5810010).
I’m not sure if I’ve done something incorrectly wrt the variable dim syntax in the config (but I don’t think so?). Either way, the console error logging doesn’t elucidate much for me.
I0802 13:44:45.879639 1 loader.cc:183] Restoring SavedModel bundle.
I0802 13:44:46.245207 1 loader.cc:133] Running initialization op on SavedModel bundle.
I0802 13:44:46.288620 1 loader.cc:298] SavedModel load for tags { serve }; Status: success. Took 455975 microseconds.
E0802 13:44:46.306244 1 retrier.cc:37] Loading servable: {name: stuff_detection version: 1} failed: Invalid argument: unable to load model 'stuff_detection', output 'detection_boxes' dims [-1,-1,-1,5] don't match configuration dims [-1,-1,-1,5]
I0802 13:44:46.306273 1 loader_harness.cc:154] Encountered an error for servable version {name: stuff_detection version: 1}: Invalid argument: unable to load model 'stuff_detection', output 'detection_boxes' dims [-1,-1,-1,5] don't match configuration dims [-1,-1,-1,5]
E0802 13:44:46.306279 1 aspired_versions_manager.cc:358] Servable {name: stuff_detection version: 1} cannot be loaded: Invalid argument: unable to load model 'stuff_detection', output 'detection_boxes' dims [-1,-1,-1,5] don't match configuration dims [-1,-1,-1,5]
Any guidance as to mistakes made, incompatibilities, or potential workarounds would be hugely appreciated.
Edit-Edit: I believe I resolved the issue, if so it was user error. I didn’t realize we aren’t intended to specify output batch dims in the config file. Removing the batch dims on output nodes seems to have worked.