dsanno / chainer-neural-style

implementation of neural style using Chainer
Other
18 stars 6 forks source link

Cpu mode support? #8

Open jmic00 opened 7 years ago

jmic00 commented 7 years ago

Looks like --gpu -1 flag doesn't affect for program.

When I use this command: python src/run.py -c re.jpg -s 4.jpg --gpu -1 I receive this output: loading content image completed loading style image completed loading neural network model completed Traceback (most recent call last): File "src/run.py", line 51, in <module> style_transfer_runner.run(args) File "/home/z/cns/src/style_transfer_runner.py", line 73, in run out_image = model.fit(content_image, style_image, args.iter, on_epoch_done) File "/home/z/cns/src/neural_style.py", line 34, in fit with cuda.Device(device_id): AttributeError: 'module' object has no attribute 'Device'

Same output with command without --gpu flag at all

dsanno commented 7 years ago

@jmic00 Thank you for your report

cuda.Device depends on 'cupy' module doesn't work without 'cupy', so I shouldn't have use it. I fixed to use cuda.get_device_from_id instead of it.