I have tried to optimize my custom frozen model to run on TensorRT using create_inference_graph(), however, the output was way larger than the original model (my model is around 200MB, but after converting it’s more than 2GB). When I increased minimum_segment_size to 30 or 40, the size was smaller but still slightly bigger than the original one (probably not many segments were converted). Is it normal that the converted model size will be bigger than the original one?
My code is as below:
trt_graph = trt.create_inference_graph( input_graph_def=frozen_graph, outputs, max_batch_size=64, max_workspace_size_bytes=1 << 25, precision_mode='FP16', minimum_segment_size=10 )
Another thing, Because the model was way too big, I couldn’t serialize it to .pb file, so that I had this error:
libprotobuf ERROR external/protobuf_archive/src/google/protobuf/message_lite.cc:289] Exceeded maximum protobuf size of 2GB: 2756916500
Has anyone ever been solving these issues? Thanks a bunch.