NVIDIA-AI-IOT / tf_trt_models

TensorFlow models accelerated with NVIDIA TensorRT
BSD 3-Clause "New" or "Revised" License
684 stars 244 forks source link

Optimized model size is too big #38

Open sonnguyen64 opened 5 years ago

sonnguyen64 commented 5 years ago

Guys,

I have tried to optimize my custom frozen model to run on TensorRT using create_inference_graph(), however, the output was larger than the original model (my model is around 200MB, but after converting it's more than 2GB). Is it normal that the converted model size is bigger than the orginal one? Below are my settings:

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
)

Also, 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 been able to solve these issues?