I am trying to load my tensorrt engine but freezes due to memory usage. I was exploring what caused my RAM to be exploded and found out that when I create tensorrt engine runtime with torch import my memory gets almost filled.
import tensorrt as trt
TRT_LOGGER = trt.Logger([trt.Logger.INFO](http://trt.logger.info/))
runtime = trt.Runtime(TRT_LOGGER)
The above code snippet takes only 200-300 mb RAM and that’s exected. But when I try the below code RAM is increased by 2 GB.
import tensorrt as trt
import torch
TRT_LOGGER = trt.Logger([trt.Logger.INFO](http://trt.logger.info/))
runtime = trt.Runtime(TRT_LOGGER)
Only difference between two snippets are torch import statement is added in later snippet.
Please let me know how to resolve this? oe Is this expected behaviour?