Closed sourcedexter closed 4 years ago
The line Allocation of 2236612608 exceeds 10% of system memory.
makes me think your system is getting out of memory. The GeForce 940MX appears to have 4GB of memory, so this won't support a large input image (I've tested the sample images on a Titan X with 12GB of memory).
Could you try a smaller image (e.g. try a 100x100 content and style image)? If that works, then we will know that this is the problem.
I wi try what you have suggested and see if it works.
However, shouldn't it have thrown an error? I checked about the allocation of memory exceeds 10% . It's not an error but a warning from tf. I suspect it's something else but I'll try what you said and let you know.
Hello all, I am using Windows 10 and could succesfully recreate the examples windows. But still I get the "exceeds 10% of system memory" when I try to transfer larger images. I googled a bit and the solution might be to adjust the batch size but I could not find something like this in the code. Is the batch size already part of the model (imagenet-vgg-verydeep-19.mat) or is it somewhere in the code?
Best regards
There isn't really a notion of "batch size" with this neural style algorithm. Batch size is always 1. If you want to process large images, you either need more GPU memory, need to tweak the implementation to do something like moving data from GPU <-> CPU memory to save on GPU memory, or use a different algorithm like fast style transfer instead.
Closing due to inactivity, feel free to re-open if you have any follow-up questions.
I have all the environment dependencies setup. When I run the script, it does not throw any error, but it doesn't train either.
Command used:
python neural_style.py --content .\xwing.jpg --styles .\space.jpg --output theout.jpg --style-weight 0.3 --style-layer-weight-exp 0.2 --pooling avg --checkpoint-output .\out\check_{}.jpg --checkpoint-iterations 50
here's the output:
2020-01-14 22:08:06.783431: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-01-14 22:08:07.313816: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1411] Found device 0 with properties: name: GeForce 940MX major: 5 minor: 0 memoryClockRate(GHz): 1.2415 pciBusID: 0000:01:00.0 totalMemory: 4.00GiB freeMemory: 3.36GiB 2020-01-14 22:08:07.329445: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1490] Adding visible gpu devices: 0 2020-01-14 22:08:08.533005: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-01-14 22:08:08.540925: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] 0 2020-01-14 22:08:08.545901: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0: N 2020-01-14 22:08:08.551660: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1103] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3073 MB memory) -> physical GPU (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0, compute capability: 5.0) 2020-01-14 22:08:13.506375: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1490] Adding visible gpu devices: 0 2020-01-14 22:08:13.515591: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-01-14 22:08:13.523388: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] 0 2020-01-14 22:08:13.529139: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0: N 2020-01-14 22:08:13.534527: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1103] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3073 MB memory) -> physical GPU (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0, compute capability: 5.0) 2020-01-14 22:08:16.440041: W tensorflow/core/framework/allocator.cc:113] Allocation of 2236612608 exceeds 10% of system memory. 2020-01-14 22:08:19.230418: W tensorflow/core/framework/allocator.cc:113] Allocation of 2236612608 exceeds 10% of system memory.
is there some way to see if an error is occurring but not being printed?