I have converted my pb file(align_webface.pb) into a tf-trt file(tensorrt_align_webface.pb). When I ran the inference, the following error occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/importer.py", line 427, in import_graph_def
graph._c_graph, serialized, options) # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: Length for attr 'OutT' of 0 must be at least minimum 1
; NodeDef: {{node MobileFaceNet/MobileFaceNet/Conv2d_0/BatchNorm/cond_1/TRTEngineOp_38}}; Op<name=TRTEngineOp; signature=in_tensor: -> out_tensor:; attr=serialized_segment:string; attr=input_shapes:list(shape); attr=output_shapes:list(shape); attr=segment_funcdef_name:string; attr=InT:list(type),min=1,allowed=[DT_INT8, DT_HALF, DT_FLOAT, DT_INT32]; attr=OutT:list(type),min=1,allowed=[DT_INT8, DT_HALF, DT_FLOAT, DT_INT32]; attr=cached_engine_batches:list(int),default=[],min=0; attr=max_cached_engines_count:int,default=1; attr=workspace_size_bytes:int; attr=precision_mode:string,allowed=["FP32", "FP16", "INT8"]; attr=calibration_data:string,default=""; attr=use_calibration:bool,default=true; attr=fixed_input_size:bool,default=true; attr=static_engine:bool,default=true>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "inference.py", line 35, in <module>
tf.import_graph_def(trt_graph, name='')
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/importer.py", line 431, in import_graph_def
raise ValueError(str(e))
ValueError: Length for attr 'OutT' of 0 must be at least minimum 1
; NodeDef: {{node MobileFaceNet/MobileFaceNet/Conv2d_0/BatchNorm/cond_1/TRTEngineOp_38}}; Op<name=TRTEngineOp; signature=in_tensor: -> out_tensor:; attr=serialized_segment:string; attr=input_shapes:list(shape); attr=output_shapes:list(shape); attr=segment_funcdef_name:string; attr=InT:list(type),min=1,allowed=[DT_INT8, DT_HALF, DT_FLOAT, DT_INT32]; attr=OutT:list(type),min=1,allowed=[DT_INT8, DT_HALF, DT_FLOAT, DT_INT32]; attr=cached_engine_batches:list(int),default=[],min=0; attr=max_cached_engines_count:int,default=1; attr=workspace_size_bytes:int; attr=precision_mode:string,allowed=["FP32", "FP16", "INT8"]; attr=calibration_data:string,default=""; attr=use_calibration:bool,default=true; attr=fixed_input_size:bool,default=true; attr=static_engine:bool,default=true>
Can anyone help me?