Hi,
I’m unable to create a .engine file on Jetson Nano
Here is my code used
import requests
import tensorflow as tf
import tensorrt as trt
import graphsurgeon as gs
import ctypes
import uff
ctypes.CDLL("/home/jet/TRT/lib/libflattenconcat.so")
uff_model_path = "tmp.uff"
engine_path = "ssd_mobilenet_v2_exam.engine"
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
trt.init_libnvinfer_plugins(TRT_LOGGER, '')
trt_runtime = trt.Runtime(TRT_LOGGER)
with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.UffParser() as parser:
builder.max_workspace_size = 1 << 30
builder.fp16_mode = True
builder.max_batch_size = 1
parser.register_input("Input", (3, 300, 300))
parser.register_output("MarkOutput_0")
parser.parse(uff_model_path, network)
print("Building TensorRT engine, this may take a few minutes...")
trt_engine = builder.build_cuda_engine(network)
trt.legacy.utils.write_engine_to_file("./ssd_mobilenet_v2_exam.engine",trt_engine.serialize())
also tried tensorrt.utils.write_engine_to_file but got the same error tensorrt has not attribute legacy or utils.
I’m using TRT version shipped with Jetson Nano Ubuntu file