Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent Error Code 3 #65

Closed
algarci104 opened this issue Oct 19, 2023 · 5 comments
Closed

Consistent Error Code 3 #65

algarci104 opened this issue Oct 19, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@algarci104
Copy link

algarci104 commented Oct 19, 2023

I have a consistent Error Code 3 no matter what dimensions I put. Down below is a small bit from the cmd for the dimensions of a 768x768 image for realisticvision. I've only crated the 7 original TensorRT presets. Also every image no matter the dimension defaults to "Profile 0:". Thanks!

[I] Loading bytes from D:\stable-diffusion-webui\models\Unet-trt\realisticVisionV51_v51VAE_a0f13c83_cc86_sample=1x4x64x64+2x4x64x64+8x4x96x96-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt
Profile 0:
sample = [(1, 4, 64, 64), (2, 4, 64, 64), (8, 4, 96, 96)]
timesteps = [(1,), (2,), (8,)]
encoder_hidden_states = [(1, 77, 768), (2, 77, 768), (8, 154, 768)]
latent = [(-1945844936), (-1945837470), (-1945839863)]

0%| | 0/25 [00:00<?, ?it/s]Loading TensorRT engine: D:\stable-diffusion-webui\models\Unet-trt\realisticVisionV51_v51VAE_a0f13c83_cc86_sample=1x4x96x96+2x4x128x128+8x4x128x128-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt
[I] Loading bytes from D:\stable-diffusion-webui\models\Unet-trt\realisticVisionV51_v51VAE_a0f13c83_cc86_sample=1x4x96x96+2x4x128x128+8x4x128x128-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt
Profile 0:
sample = [(1, 4, 96, 96), (2, 4, 128, 128), (8, 4, 128, 128)]
timesteps = [(1,), (2,), (8,)]
encoder_hidden_states = [(1, 77, 768), (2, 77, 768), (8, 154, 768)]
latent = [(-1945904758), (-1945904374), (-1945898097)]

[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 [1,231,768] for bindings[2] exceed min ~ max range at index 1, maximum dimension in profile is 154, minimum dimension in profile is 77, but supplied dimension is 231.
)
[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 [1,231,768] for bindings[2] exceed min ~ max range at index 1, maximum dimension in profile is 154, minimum dimension in profile is 77, but supplied dimension is 231.
)
4%|████████ | 1/25 [00:03<01:31, 3.83s/it][

@PhreakHeaven
Copy link

I have a consistent Error Code 3 no matter what dimensions I put. Down below is a small bit from the cmd for the dimensions of a 768x768 image for realisticvision. I've only crated the 7 original TensorRT presets. Also every image no matter the dimension defaults to "Profile 0:". Thanks!

[I] Loading bytes from D:\stable-diffusion-webui\models\Unet-trt\realisticVisionV51_v51VAE_a0f13c83_cc86_sample=1x4x64x64+2x4x64x64+8x4x96x96-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt Profile 0: sample = [(1, 4, 64, 64), (2, 4, 64, 64), (8, 4, 96, 96)] timesteps = [(1,), (2,), (8,)] encoder_hidden_states = [(1, 77, 768), (2, 77, 768), (8, 154, 768)] latent = [(-1945844936), (-1945837470), (-1945839863)]

0%| | 0/25 [00:00<?, ?it/s]Loading TensorRT engine: D:\stable-diffusion-webui\models\Unet-trt\realisticVisionV51_v51VAE_a0f13c83_cc86_sample=1x4x96x96+2x4x128x128+8x4x128x128-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt [I] Loading bytes from D:\stable-diffusion-webui\models\Unet-trt\realisticVisionV51_v51VAE_a0f13c83_cc86_sample=1x4x96x96+2x4x128x128+8x4x128x128-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt Profile 0: sample = [(1, 4, 96, 96), (2, 4, 128, 128), (8, 4, 128, 128)] timesteps = [(1,), (2,), (8,)] encoder_hidden_states = [(1, 77, 768), (2, 77, 768), (8, 154, 768)] latent = [(-1945904758), (-1945904374), (-1945898097)]

[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 [1,231,768] for bindings[2] exceed min ~ max range at index 1, maximum dimension in profile is 154, minimum dimension in profile is 77, but supplied dimension is 231. ) [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 [1,231,768] for bindings[2] exceed min ~ max range at index 1, maximum dimension in profile is 154, minimum dimension in profile is 77, but supplied dimension is 231. ) 4%|████████ | 1/25 [00:03<01:31, 3.83s/it][

Same.

@contentis contentis added the bug Something isn't working label Oct 19, 2023
@contentis
Copy link
Collaborator

Can it be that your prompt is very long? By default, the max prompt length is set to 154 tokens. If you want to resolve this you need to export the engine with a larger "Max prompt token count" in the advanced settings.

@algarci104
Copy link
Author

Can it be that your prompt is very long? By default, the max prompt length is set to 154 tokens. If you want to resolve this you need to export the engine with a larger "Max prompt token count" in the advanced settings.

Looks like it worked by lowering my prompt value! However, even though I create custom profiles with larger opt or max text length the cmd shows that it keeps defaulting to profile 0 even when at the specified or higher dimensions. When I try to use any high text prompts it gives me the error.

@contentis
Copy link
Collaborator

The Using: Profile 0 message is unrelated to the engines you have exported. Technically, you can have multiple profiles backed into a single engine file. I know that this is confusing, but there is now way for me to disable/change this print in tensorrt easily.

@algarci104
Copy link
Author

algarci104 commented Oct 19, 2023

The Using: Profile 0 message is unrelated to the engines you have exported. Technically, you can have multiple profiles backed into a single engine file. I know that this is confusing, but there is now way for me to disable/change this print in tensorrt easily.

My bad 😅. I understand now. It seems that with a lower text prompt in positive and negative it works perfectly at any dimensions so I'll stick to that. Thank you for your help and for aiding the community. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants