PyTorch-Spiking-YOLOv3 icon indicating copy to clipboard operation
PyTorch-Spiking-YOLOv3 copied to clipboard

内存开销问题

Open 1y9y9l4 opened this issue 4 years ago • 3 comments

你好, 非常感谢你的源码,解决了我对Spiking YOLO的很多疑惑。 但我在运行ann_to_snn.py的过程中遇到了内存开销过高的问题,导致device='cpu'时内存占用将近80G,而无法在GPU上运行。 我发现在调用例如: https://github.com/cwq159/PyTorch-Spiking-YOLOv3/blob/941c3faddc2ecc6ab02086a5f50b46732ee0894d/spiking_utils/snn_transformer.py#L94 内存/显存开销不断增长,并且不会释放。 同样的问题出现在了: https://github.com/cwq159/PyTorch-Spiking-YOLOv3/blob/941c3faddc2ecc6ab02086a5f50b46732ee0894d/ann_to_snn.py#L183 我尝试过添加torch.cuda.empty_cache(),没有取得效果。请问这是否存在了某些内存/显存泄露问题? (FYI:所用到pytorch=1.3.0,cudatoolkit=10.1)

1y9y9l4 avatar Sep 06 '21 09:09 1y9y9l4

由于batch_size * timesteps比较大,确实会导致内存开销非常大,如果内存hold不住,可以尝试调小这两个参数。

cwq159 avatar Sep 07 '21 03:09 cwq159

@1y9y9l4 Hello, sorry to bother you, but I wonder where Pytorch=1.3 was downloaded from. Thanks so much!

buaa-luzhi avatar Jan 06 '22 10:01 buaa-luzhi

I downloaded from anaconda. conda install pytorch=1.3

1y9y9l4 avatar Jan 10 '22 04:01 1y9y9l4