From c7593a59c7c9d746345ba7413a129ccb4d5e06b9 Mon Sep 17 00:00:00 2001 From: Renzo Gambone Date: Tue, 5 Oct 2021 13:50:33 -0300 Subject: [PATCH 1/3] Update Jetpack 4.6.1 --- exporters/trt_exporter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exporters/trt_exporter.py b/exporters/trt_exporter.py index 2db74a2..a505d73 100644 --- a/exporters/trt_exporter.py +++ b/exporters/trt_exporter.py @@ -64,14 +64,15 @@ def export_trt(pb_file, output_dir, num_classes=90, neuralet_adaptive_model=1): debug_mode=False) input_dims = (3, 300, 300) with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.UffParser() as parser: - builder.max_workspace_size = 1 << 28 + config = builder.create_builder_config() + config.max_workspace_size = 1 << 28 builder.max_batch_size = 1 - builder.fp16_mode = True + #builder.fp16_mode = True TODO: Deprecated in TRT8 is it done automatically? parser.register_input('Input', input_dims) parser.register_output('MarkOutput_0') parser.parse(uff_path, network) - engine = builder.build_cuda_engine(network) + engine = builder.build_engine(network, config) buf = engine.serialize() engine_path = os.path.join(output_dir, model_file_name + ".bin") From 27db3c86e0ff9086a94615e77fa4e90c1902da4f Mon Sep 17 00:00:00 2001 From: Renzo Gambone Date: Tue, 5 Oct 2021 13:52:59 -0300 Subject: [PATCH 2/3] update jetson-nano dockerfile --- jetson-nano.Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetson-nano.Dockerfile b/jetson-nano.Dockerfile index 0083c1b..acdaad5 100644 --- a/jetson-nano.Dockerfile +++ b/jetson-nano.Dockerfile @@ -3,9 +3,9 @@ # 1) build: docker build -f Dockerfile -t "neuralet/jetson-nano:tf-ssd-to-trt" . # 2) run: docker run -it --runtime nvidia --privileged --network host -v /PATH_TO_DOCKERFILE_DIRECTORY/:/repo neuralet/jetson-nano:tf-ssd-to-trt -#FROM nvcr.io/nvidia/l4t-base:r32.4.4 +#FROM nvcr.io/nvidia/l4t-base:r32.6.1 -FROM nvcr.io/nvidia/l4t-tensorflow:r32.4.4-tf1.15-py3 +FROM nvcr.io/nvidia/l4t-tensorflow:r32.6.1-tf1.15-py3 ENV TZ=US/Pacific RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -31,7 +31,7 @@ RUN apt-get install -y graphsurgeon-tf uff-converter-tf RUN pip3 install protobuf RUN apt-get install -y pkg-config libhdf5-100 libhdf5-dev RUN apt-get install -y python3-h5py python3-opencv -RUN pip3 install wget pillow +RUN pip3 install wget pillow nvidia-pyindex COPY ./exporters/libflattenconcat.so.6 /opt/libflattenconcat.so RUN apt update && apt install -y libtcmalloc-minimal4 From ad8e92f6172aa06cbafd0a4ac27dd3572990bb52 Mon Sep 17 00:00:00 2001 From: Mahsa Date: Sat, 23 Oct 2021 20:56:27 +0300 Subject: [PATCH 3/3] fixed jetpack 4.6.1 uncompatibility issue --- exporters/trt_exporter.py | 9 ++++----- jetson-nano.Dockerfile | 4 +--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/exporters/trt_exporter.py b/exporters/trt_exporter.py index a505d73..660ddcb 100644 --- a/exporters/trt_exporter.py +++ b/exporters/trt_exporter.py @@ -63,16 +63,15 @@ def export_trt(pb_file, output_dir, num_classes=90, neuralet_adaptive_model=1): text=True, debug_mode=False) input_dims = (3, 300, 300) - with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.UffParser() as parser: - config = builder.create_builder_config() - config.max_workspace_size = 1 << 28 + with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, builder.create_builder_config() as builder_config, trt.UffParser() as parser: + builder_config.max_workspace_size = 1 << 28 builder.max_batch_size = 1 - #builder.fp16_mode = True TODO: Deprecated in TRT8 is it done automatically? + builder_config.set_flag(trt.BuilderFlag.FP16) parser.register_input('Input', input_dims) parser.register_output('MarkOutput_0') parser.parse(uff_path, network) - engine = builder.build_engine(network, config) + engine = builder.build_engine(network, builder_config) buf = engine.serialize() engine_path = os.path.join(output_dir, model_file_name + ".bin") diff --git a/jetson-nano.Dockerfile b/jetson-nano.Dockerfile index acdaad5..3bd1901 100644 --- a/jetson-nano.Dockerfile +++ b/jetson-nano.Dockerfile @@ -3,8 +3,6 @@ # 1) build: docker build -f Dockerfile -t "neuralet/jetson-nano:tf-ssd-to-trt" . # 2) run: docker run -it --runtime nvidia --privileged --network host -v /PATH_TO_DOCKERFILE_DIRECTORY/:/repo neuralet/jetson-nano:tf-ssd-to-trt -#FROM nvcr.io/nvidia/l4t-base:r32.6.1 - FROM nvcr.io/nvidia/l4t-tensorflow:r32.6.1-tf1.15-py3 ENV TZ=US/Pacific RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -31,7 +29,7 @@ RUN apt-get install -y graphsurgeon-tf uff-converter-tf RUN pip3 install protobuf RUN apt-get install -y pkg-config libhdf5-100 libhdf5-dev RUN apt-get install -y python3-h5py python3-opencv -RUN pip3 install wget pillow nvidia-pyindex +RUN pip3 install wget pillow COPY ./exporters/libflattenconcat.so.6 /opt/libflattenconcat.so RUN apt update && apt install -y libtcmalloc-minimal4