Closed Wisgon closed 6 years ago
I setup my environment as your guides in readme, when I run:
$ ./eval.py -i configs/srresnet.json resources/pretrained/srresnet.pth path/to/image.jpg
AND
$./eval.py -i configs/srgan.json resources/pretrained/srgan.pth path/to/image.jpg
they both run out of memory, here is the error output:
Running on GPU 0
Restored checkpoint from resources/pretrained/srgan.pth
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1512386481460/work/torch/lib/THC/generic/THCStorage.cu line=58 error=2 : out of memory
Traceback (most recent call last):
File "eval.py", line 157, in
I guess you used an image which is too large.
This network is pretty memory intensive. For upscaling a 512x512 image, I saw a peak memory usage of 12GB.
I don't know what exactly Pytorch needs to hold in memory. I guess a minimum bound of memory the network needs is 2 16 width height 256 * 4 bytes, which is based on the output size of the largest feature map the network computes (and which it needs to hold twice, as input and output). In addition, the network parameters must be hold in memory, which is an additional couple hundred megabytes.
If you have enough RAM, you can try to upscale on your CPU using the -c ''
switch. This will, of course, take longer than on GPU. Another option would be to crop the image into parts and upscale each part individually.
Thanks for reply, it works when I use a smaller picture! Thank you very much.
Hi, thanks for the job,first. I got an out of memory error, I have a GTX1070ti GPU and it has a 8GB memory, So, how many memory does this app need?