KunpengLi1994 / VSRN

PyTorch code for ICCV'19 paper "Visual Semantic Reasoning for Image-Text Matching"
288 stars 47 forks source link

MemoryError: Unable to allocate 31.1 GiB #22

Closed By-he closed 2 years ago

By-he commented 3 years ago

First of all, thank you very much for your contribution to the thesis code. When I am running your file, I have the problem of "MemoryError: Unable to allocate 31.1 GiB for an Array with shape (8352423936,) and data Type Float32". May I ask which parameters Can be modified to work normally? My computer configuration is RTX2060, 6G video memory, and 16G running memory

KunpengLi1994 commented 2 years ago

It seems the issue is because the code will first load all the data in to memory for efficient training. I suggest you try the code using desktop with larger memory. Otherwise, you need to revise the code like here : https://github.com/KunpengLi1994/VSRN/blob/master/data.py#L217 and enable load each image from the disk rather than from memory.