yusuketomoto / chainer-fast-neuralstyle

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

Memory error without GPU. #89

Open yangboz opened 7 years ago

yangboz commented 7 years ago

Error information as following, Wonder how many memory it takes? Traceback (most recent call last): File "generate.py", line 45, in y = model(x) File "/root/chainer-fast-neuralstyle/net.py", line 61, in call h = self.r4(h, test=test) File "/root/chainer-fast-neuralstyle/net.py", line 20, in call h = F.relu(self.b1(self.c1(x), test=test)) File "/usr/local/lib/python2.7/dist-packages/chainer/links/connection/convolution_2d.py", line 109, in call deterministic=self.deterministic) File "/usr/local/lib/python2.7/dist-packages/chainer/functions/connection/convolution_2d.py", line 417, in convolution_2d return func(x, W, b) File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 199, in call outputs = self.forward(in_data) File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 312, in forward return self.forward_cpu(inputs) File "/usr/local/lib/python2.7/dist-packages/chainer/functions/connection/convolution_2d.py", line 80, in forward_cpu cover_all=self.cover_all) File "/usr/local/lib/python2.7/dist-packages/chainer/utils/conv.py", line 33, in im2col_cpu col = numpy.ndarray((n, c, kh, kw, out_h, out_w), dtype=img.dtype) MemoryError

l1yefeng commented 6 years ago

Facing same error. Running in Python 3.6.3 virtual environment with the following installed:

chainer (1.17.0)
Django (1.11.7)
filelock (2.0.13)
image (1.5.16)
nose (1.3.7)
numpy (1.13.3)
olefile (0.44)
Pillow (4.3.0)
pip (9.0.1)
protobuf (3.5.0)
pytz (2017.3)
setuptools (28.8.0)
six (1.11.0)

The error is:

Traceback (most recent call last):
  File "generate.py", line 45, in <module>
    y = model(x)
  File "/home/nickl/Documents/github/chainer-fast-neuralstyle/net.py", line 55, in __call__
    h = self.b1(F.elu(self.c1(x)), test=test)
  File "/home/nickl/.pyenv/versions/chainer/lib/python3.6/site-packages/chainer/links/connection/convolution_2d.py", line 101, in __call__
    x, self.W, self.b, self.stride, self.pad, self.use_cudnn)
  File "/home/nickl/.pyenv/versions/chainer/lib/python3.6/site-packages/chainer/functions/connection/convolution_2d.py", line 318, in convolution_2d
    return func(x, W, b)
  File "/home/nickl/.pyenv/versions/chainer/lib/python3.6/site-packages/chainer/function.py", line 197, in __call__
    outputs = self.forward(in_data)
  File "/home/nickl/.pyenv/versions/chainer/lib/python3.6/site-packages/chainer/function.py", line 311, in forward
    return self.forward_cpu(inputs)
  File "/home/nickl/.pyenv/versions/chainer/lib/python3.6/site-packages/chainer/functions/connection/convolution_2d.py", line 68, in forward_cpu
    cover_all=self.cover_all)
  File "/home/nickl/.pyenv/versions/chainer/lib/python3.6/site-packages/chainer/utils/conv.py", line 34, in im2col_cpu
    col = numpy.ndarray((n, c, kh, kw, out_h, out_w), dtype=img.dtype)
MemoryError