Closed ccarmatic closed 4 months ago
I found the problem, it was because I was trying to use a different dimension of image in Streamdiffusion than 512x512
I have solved this problem:
The engine needs to be rebuilt (delete 'engines' folder) , with these arguments passed into accelerate_with_tensorrt
:
resolutiondict = {'engine_build_options' : {'opt_image_height': HEIGHT, 'opt_image_width': WIDTH}}
stream = accelerate_with_tensorrt(
stream, "engines", max_batch_size=BATCH_SIZE,engine_build_options=resolutiondict
)
I think WIDTH and HEIGHT needs to be multiples of 64 , and increasing BATCH_SIZE from 1 can increase performance, but increasing these numbers will increase the VRAM usage of the engine building process, the values working with my RTX4080 with 16GB of RAM are width=832 , height = 512, batch size = 3 , increasing any of these numbers will result in an insufficient memory error when building the engine
I have tried to use
, and this is the result this seems to be the main error message:
[E] 3: [executionContext.cpp::nvinfer1::rt::ExecutionContext::validateInputBindings::2045] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::nvinfer1::rt::ExecutionContext::validateInputBindings::2045, condition: profileMaxDims.d[i] >= dimensions.d[i]. Supplied binding dimension [2,4,67,120] for bindings[0] exceed min ~ max range at index 2, maximum dimension in profile is 64, minimum dimension in profile is 64, but supplied dimension is 67. )