From 4657ec14cd986682af6f964e195e0e10fcf33d1a Mon Sep 17 00:00:00 2001 From: Thibault N Date: Tue, 5 Apr 2022 14:40:41 +0200 Subject: [PATCH] Hot fix trt exporter --- alonet/torch2trt/base_exporter.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/alonet/torch2trt/base_exporter.py b/alonet/torch2trt/base_exporter.py index 5cb7b07e..354cfa54 100644 --- a/alonet/torch2trt/base_exporter.py +++ b/alonet/torch2trt/base_exporter.py @@ -14,7 +14,8 @@ import tensorrt as trt import pycuda.driver as cuda prod_package_error = None -except Exception as prod_package_error: +except Exception as e: + prod_package_error = e pass @@ -93,10 +94,6 @@ def __init__( """ if prod_package_error is not None: raise prod_package_error - if prod_package_error is not None: - raise prod_package_error - if prod_package_error is not None: - raise prod_package_error if model is not None: assert hasattr(model, "tracing") and model.tracing, "Model must be instantiated with tracing=True"