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"