mli0603 / stereo-transformer

Revisiting Stereo Depth Estimation From a Sequence-to-Sequence Perspective with Transformers. (ICCV 2021 Oral)
Apache License 2.0
659 stars 107 forks source link

How much memory is needed to run the example? #66

Open neuzyy opened 2 years ago

neuzyy commented 2 years ago

i run inference example on a 2080ti,but out of memory

lfxx commented 2 years ago

Same issue here

mli0603 commented 2 years ago

Hi @lfxx @neuzyy,

The STTR builds a full resolution feature so it can sparsely sample the feature at different stride as discussed in Sec 3.5. This unfortunately, together with attention mechanism, requires a large memory. To avoid this, there are two ways

Let me know if you have more issues!

lfxx commented 2 years ago

Hi @lfxx @neuzyy,

The STTR builds a full resolution feature so it can sparsely sample the feature at different stride as discussed in Sec 3.5. This unfortunately, together with attention mechanism, requires a large memory. To avoid this, there are two ways

  • Set the stride higher. By default it is 3, you can set it to 4 and see.
  • Another way, which is more recommended, is lightweight STTR as discussed in Appendix H. Remember to checkout the sttr-light branch to use the code.

Let me know if you have more issues!

Thanks for your kindly reply.Now i have quite large pictures such as 1920*1080,Even if i use sttr-light model,i still get OOM error on GTX2080TI.Any suggestions such as resize the picture to a smaller size?

mli0603 commented 2 years ago

Hi @lfxx

Yes, downsampling will definitely help. A 2x downsampling will cut the memory consumption by more than 4 times.