gebbissimo:

Could it be that at some point GPU memory is not deallocated quickly enough and that some wait statements would solve it?


This shouldn’t be the case, as PyTorch tries to recover from an OOM by clearing the cache for you.
Are you seeing these issues only in this old monodepth2 repository or also using plain PyTorch code?