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

Compilation failed due to large activation tensors in model #449

Closed
NandhiniN85 opened this issue Aug 24, 2021 · 7 comments
Closed

Compilation failed due to large activation tensors in model #449

NandhiniN85 opened this issue Aug 24, 2021 · 7 comments
Assignees
Labels
comp:compiler Compiler related issues comp:model Model related isssues Hardware:USB Accelerator Coral USB Accelerator issues subtype:windows Windos Build/installation issues type:support Support question or issue

Comments

@NandhiniN85
Copy link

Description

I am trying to edge compile yolov5s with a resolution of 512(only one class), but every time the compilation process results in "Compilation failed due to large activation tensors in model". I was referring to the previous issue #405 and there looks like @taloot and @pirazor were able to execute the models with image sizes 512 & 416 respectively. But I am not sure what I am missing, I used the tf.py from zldrobit to make the conversion. Please let me know why the compilation fails.

Notebook used, custom yaml file, best.pt, int8 tflite are present here - https://drive.google.com/drive/folders/16Q76WeIKSF6FlqUJ86HOWDTC1Hi8pvJt?usp=sharing

Notes: For now I have used the publically dataset from roboflow(due to privacy concerns could not share the actual weight). But the problem is same for both. Thanks

Issue Type

Bug

Operating System

Windows 10

Coral Device

USB Accelerator

Other Devices

Rapsberry Pi 4

Programming Language

Python 3.9

Relevant Log Output

Edge TPU Compiler version 16.0.384591198
Started a compilation timeout timer of 180 seconds.
ERROR: Restored original execution plan after delegate application failure.
Compilation failed: Compilation failed due to large activation tensors in model.
Compilation child process completed within timeout period.
Compilation failed!
@hjonnala hjonnala self-assigned this Aug 24, 2021
@hjonnala hjonnala added comp:compiler Compiler related issues comp:model Model related isssues Hardware:USB Accelerator Coral USB Accelerator issues subtype:windows Windos Build/installation issues type:support Support question or issue labels Aug 24, 2021
@hjonnala
Copy link
Contributor

Please try with tensorflow==2.5.0 and let us know if unable to compile the model.

@NandhiniN85
Copy link
Author

@hjonnala I quickly reran the process with the suggestion, but the problem still persists. Thanks!

@taloot
Copy link

taloot commented Aug 24, 2021

u should use -a -d flags and wait it should work
i manage to compile yolov5s and m also m6
all works just the problem is the resolution limitation

@taloot
Copy link

taloot commented Aug 24, 2021

i check it and it works
Edge TPU Compiler version 16.0.384591198
Input: best-int8.tflite
Output: best-int8_edgetpu.tflite

1. `Operator`                       Count      Status
2. 
3. CONCATENATION                  13         Mapped to Edge TPU
4. CONCATENATION                  1          More than one subgraph is not supported
5. MAX_POOL_2D                    3          Mapped to Edge TPU
6. QUANTIZE                       16         Mapped to Edge TPU
7. QUANTIZE                       1          Operation is otherwise supported, but not mapped due to some unspecified limitation
8. TRANSPOSE                      2          Mapped to Edge TPU
9. TRANSPOSE                      1          Operation is otherwise supported, but not mapped due to some unspecified limitation
10. PAD                            6          Mapped to Edge TPU
11. ADD                            7          Mapped to Edge TPU
12. STRIDED_SLICE                  4          More than one subgraph is not supported
13. MUL                            59         Mapped to Edge TPU
14. CONV_2D                        62         Mapped to Edge TPU
15. LOGISTIC                       59         Mapped to Edge TPU
16. RESIZE_NEAREST_NEIGHBOR        2          Mapped to Edge TPU
17. RESHAPE                        3          Mapped to Edge TPU``

@NandhiniN85
Copy link
Author

NandhiniN85 commented Aug 25, 2021

@taloot This is great and the issue is resolved. But one question though, for every step I received the below error. I hope you got a similar one even though the final conversion was successful. Kindly confirm. Thanks!

Try to compile segment with 16 ops
Intermediate tensors: model_1/tf__conv_1/mul,model_1/tf__c3/tf__conv_3/mul
Started a compilation timeout timer of 180 seconds.
ERROR: Restored original execution plan after delegate application failure.
Compilation failed: Compilation failed due to large activation tensors in model.
Compilation child process completed within timeout period.
Compilation failed!

best-int8_edgetpu.log

@taloot
Copy link

taloot commented Aug 25, 2021

yes sure but what we care most is having working sloution,

@NandhiniN85
Copy link
Author

yes sure but what we care most is having working sloution,

Thanks for your timely response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:compiler Compiler related issues comp:model Model related isssues Hardware:USB Accelerator Coral USB Accelerator issues subtype:windows Windos Build/installation issues type:support Support question or issue
Projects
None yet
Development

No branches or pull requests

3 participants