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

EfficientNet convert to tensorrt model failed. #333

Closed
FroyoZzz opened this issue Nov 21, 2019 · 5 comments
Closed

EfficientNet convert to tensorrt model failed. #333

FroyoZzz opened this issue Nov 21, 2019 · 5 comments
Labels
triaged Issue has been triaged by maintainers

Comments

@FroyoZzz
Copy link

Hi,all.
I am trying to convert a trained EfficientNet-b2 model into tensorrt format.When I use a tensor of shape (1, 3, 512, 512) ,it succeed and everything worked well.But when I try a tensor of shape (1, 3, 1024, 1024),it failed in converting onnx to trt. I got this error:

[E] [TRT] Parameter check failed at: Network.cpp::nvinfer1::Network::addPoolingNd::500, condition: allDimsGtEq(windowSize, 1) && volume(windowSize) < MAX_KERNEL_DIMS_PRODUCT
While parsing node number 10 [GlobalAveragePool]:
ERROR: builtin_op_importers.cpp:1175 In function importGlobalAveragePool:
[8] Assertion failed: layer_ptr

Such a high resolution is not supported yet?
I am using the Windows 10; Tensorrt 6.0.1; CUDA 10.1;and pytorch 1.2 version.
Thank you!

@githubgsq
Copy link

@FroyoZzz I met the similar error. Have you solved it please?

@basaltzhang
Copy link

basaltzhang commented Feb 24, 2020

I think this value is coded in TensorRT. Unfortunately, this part is not in open source directories.
One tricky method is double avg_pooling

        # Squeeze and Excitation
        if self.has_se:
            if self.training:
                x_squeezed = F.adaptive_avg_pool2d(x, 1)
            else:
                a = F.adaptive_avg_pool2d(x, 2)
                x_squeezed = F.adaptive_avg_pool2d(a, 1)

@DataXujing
Copy link

I met the similar error. Have you solved it please?

@ttyio
Copy link

ttyio commented Sep 18, 2020

Hello @FroyoZzz @githubgsq @basaltzhang @daquexian, Have you solved the issue?The error what you seen is a plausibility check for kernel size in TensorRT. We have plan to relax the check in future versions.
If you use TensorRT 7.*, the onnx operator GlobalAveragePool is implemented using IReduceLayer, so you will no longer hit this issue. Could you take a try? thanks!

@kevinch-nv kevinch-nv added the triaged Issue has been triaged by maintainers label Apr 16, 2021
@kevinch-nv
Copy link
Collaborator

Closing due to inactivity - if you still have issues with the latest TRT version feel free to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

6 participants