fast-style-transfer
fast-style-transfer copied to clipboard
Codes only Training on CPU
I have question about codes In src/optimize.py,
with tf.Graph().as_default(), tf.device('/cpu:0'), tf.Session() as sess:
I Thought it is meant to training on the CPU (I mean using cpu). And if I run this code, It only use GPU Memory and doesn't use its processing power. and If I trying to change cpu into gpu, It occurs error below.
tensorflow.python.framework.errors_imp.InvalidArgumentError: Cannot assign a device for operation ‘save/SaveV2’: Could not satisfy explicit device specification ‘/device:GPU:0’ because no supported kernel for GPU devices is available
So I erased the 'tf.device ' part and It worked fine. Am I misunderstood something?
I'm using TF version - 1.4 Python 2.7.12 CUDA 8.0 with cudnn
I hope it would help someone with this error like me.
That line of code line 31
is for preprocessing data in optimize.py. It does not affect training, it only loads files into memory.
line 42
with tf.Graph().as_default(), tf.Session() as sess:
is where training occurs, and it should use your GPU (if you have one) by default.