Hi all, I tried using build_cuda_engine(network) but it throws the error as below
engine = builder . build_cuda_engine ( network )
AttributeError: ‘tensorrt.tensorrt.Builder’ object has no attribute ‘build_cuda_engine’. Did you mean: ‘build_engine’?
Few details about existing software/libraries
Cuda version - cuda-12.2
Jetpack version is 6
Please let me know what could be the reason.
Thanks and Regards
Nagaraj. Trivedi
Hi,
The API has changed.
Please follow the below sample to run an ONNX model with TensorRT 8.6:
# Path to which trained model will be saved (check README.md)
ENGINE_FILE_PATH = os.path.join(WORKING_DIR, 'bidaf.trt')
# Define global logger object (it should be a singleton,
# available for TensorRT from anywhere in code).
# You can set the logger severity higher to suppress messages
# (or lower to display more messages)
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
# Builds TensorRT Engine
def build_engine(model_path):
builder = trt.Builder(TRT_LOGGER)
network = builder.create_network(common.EXPLICIT_BATCH)
config = builder.create_builder_config()
parser = trt.OnnxParser(network, TRT_LOGGER)
runtime = trt.Runtime(TRT_LOGGER)
# Parse model file
print("Loading ONNX file from path {}...".format(model_path))
Thanks.
Hi, thank you for providing this info. I will try this and let you know.
Thanks and Regards
Nagaraj Trivedi
system
Closed
August 14, 2024, 4:56am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.