Fix TRT `max_workspace_size` deprecation notice (#6856)

* Fix TRT `max_workspace_size` deprecation notice

* Update export.py

* Update export.py
This commit is contained in:
Glenn Jocher 2022-03-07 13:52:53 +01:00 committed by GitHub
parent a5a1760ea6
commit acc58c1dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -218,6 +218,7 @@ def export_engine(model, im, file, train, half, simplify, workspace=4, verbose=F
builder = trt.Builder(logger)
config = builder.create_builder_config()
config.max_workspace_size = workspace * 1 << 30
# config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, workspace << 30) # fix TRT 8.4 deprecation notice
flag = (1 << int(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH))
network = builder.create_network(flag)