yusuketomoto / chainer-fast-neuralstyle

Chainer implementation of "Perceptual Losses for Real-Time Style Transfer and Super-Resolution".
MIT License
805 stars 229 forks source link

Chainer GPU #24

Open enzyme69 opened 7 years ago

enzyme69 commented 7 years ago

I am using Windows 7, Anaconda, whenever I install CUPY and try to run Chainer with GPU, it crashes. Any step by step tutorial on how to ensure GPU works? CPU is waaay... too slow. 1500 photos take whole day.

ttoinou commented 7 years ago

Hi, what is the message error ? I'm on Win10 with nvidia & cudnn & GTX 980 and everything works fine

enzyme69 commented 7 years ago

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

E:_PYTOOLS\chainer-fast>python generate.py sample_images/snail.png -m models/se urat.model -o results/snail_s.png -g 0 Traceback (most recent call last): File "generate.py", line 30, in y = model(x) File "E:_PYTOOLS\chainer-fast\net.py", line 55, in call h = self.b1(F.elu(self.c1(x)), test=test) File "C:\Python27\lib\site-packages\chainer\links\connection\convolution_2d.py ", line 82, in call x, self.W, self.b, self.stride, self.pad, self.use_cudnn) File "C:\Python27\lib\site-packages\chainer\functions\connection\convolution_2 d.py", line 316, in convolution_2d return func(x, W, b) File "C:\Python27\lib\site-packages\chainer\function.py", line 130, in _call _ outputs = self.forward(in_data) File "C:\Python27\lib\site-packages\chainer\function.py", line 234, in forward

return self.forward_gpu(inputs)

File "C:\Python27\lib\site-packages\chainer\functions\connection\convolution_2 d.py", line 90, in forward_gpu x = cuda.cupy.ascontiguousarray(x) File "C:\Python27\lib\site-packages\cupy\creation\from_data.py", line 78, in a scontiguousarray return core.ascontiguousarray(a, dtype) File "cupy/core/core.pyx", line 1427, in cupy.core.core.ascontiguousarray (cup y\core\core.cpp:49842) File "cupy/core/core.pyx", line 1437, in cupy.core.core.ascontiguousarray (cup y\core\core.cpp:49724) File "cupy/core/core.pyx", line 1293, in cupy.core.core.elementwise_copy (cupy \core\core.cpp:48776) File "cupy/core/elementwise.pxi", line 768, in cupy.core.core.ufunc.call ( cupy\core\core.cpp:39715) File "cupy/util.pyx", line 36, in cupy.util.memoize.decorator.ret (cupy\util.c pp:1264) File "cupy/core/elementwise.pxi", line 576, in cupy.core.core._get_ufunc_kerne l (cupy\core\core.cpp:36329) File "cupy/core/elementwise.pxi", line 32, in cupy.core.core._get_simple_eleme ntwise_kernel (cupy\core\core.cpp:26928) File "cupy/core/carray.pxi", line 87, in cupy.core.core.compile_with_cache (cu py\core\core.cpp:26615) File "C:\Python27\lib\site-packages\cupy\cuda\compiler.py", line 119, in compi le_with_cache base = _empty_file_preprocess_cache[env] = preprocess('', options) File "C:\Python27\lib\site-packages\cupy\cuda\compiler.py", line 82, in prepro cess pp_src = _run_nvcc(cmd, root_dir) File "C:\Python27\lib\site-packages\cupy\cuda\compiler.py", line 44, in _run_n vcc raise RuntimeError(msg) RuntimeError: nvcc command returns non-zero exit status. command: ['nvcc', '--preprocess', '-Xcompiler', '/wd 4819', '-m64', 'c:\users\ jimmy\appdata\local\temp\tmpo4ds4g\kern.cu'] return-code: 1 stdout/stderr: nvcc fatal : Cannot find compiler 'cl.exe' in PATH

E:_PYTOOLS\chainer-fast>

ttoinou commented 7 years ago

Oh, I've been through that error. You have to install Microsoft Visual Studio and then CUDA. If it still doesn't work, you should tweak your environment PATH so that chainer can find cl.exe somethjng like C:\Program Files\Microsoft Visual Studio 10.0\VC\bin . However, maybe cl.exe can be found in another MS package, than Visual Studio, I don't know.

If it still doesn't work, try to use Miniconda2 (I use that).