Closed AllanYiin closed 7 years ago
What's your GPU?
I use my surfacebook, equal to GTX950, 1GB GDDR5
The first load is from disk to RAM. The model() call loads from RAM to GPU. The VGG model is big but we only load the convolutional part which is about 50Mb, the problem comes from having to store a lot of the layers.
One possibility that might work for you is to reduce the SIZE variable. Try SIZE=200 (should use 56% less memory) or 100 (should use 89% less memory). Try to find the largest SIZE that fits in your card without failing because if the SIZE is small the details of the input will be lost.
Once you get it to work you can also modify the implementation so that it is less demanding on memory. I think removing all the intermediate layers from the loss function and from the outputs of the network should help.
There's also the possibility of running everything on CPU which you can do with
C.set_default_device(C.cpu())
as the first thing after importing cntk
I try to use the great Artistic Style Transfer exsample , but every one when run at " z, intermediate_layers = model(y, layers)
then the system will throw out of memory exception. Is this caurse by load VGG-16 model? Vgg model shoud load at previous "print(f.attrs['nb_layers'])" step, and It work good?? Is anyway to prevent this sutuation.
RuntimeError Traceback (most recent call last)