crowsonkb / style_transfer

Data-parallel image stylization using Caffe.
MIT License
113 stars 14 forks source link

operands could not be broadcast together with shapes #6

Closed rayset closed 7 years ago

rayset commented 7 years ago

when I give this command: python2 style_transfer.py Caesar.jpg rsz_vaticangoo.jpg --size 1024 --tile-size 512

i get this error after pass 10:

Pass 10 Using 2x2 tiles of size 402x512. Process Process-2: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(_self._args, _self._kwargs) File "style_transfer.py", line 276, in run req.dd_layers, req.content_weight, req.style_weight, req.dd_weight) File "style_transfer.py", line 505, in eval_sc_grad_tile loss += content_weight \ np.sum((self.data[layer] - self.features[layer])**2) / 2 ValueError: operands could not be broadcast together with shapes (512,64,51) (512,128,101)

and then I have to kill the process.

I'm using python 2 with your makefile from reddit and atlas. gtx 1070.

Any idea on what it could be?

rayset commented 7 years ago

it works with default image size, so I guess the installation is fine :)

crowsonkb commented 7 years ago

Fixed: https://github.com/crowsonkb/style_transfer/commit/4d0750b17cd5fd8ba9b9dcfc6a061c61fac046e3

I introduced a bug last night and didn't notice it because it only crashed when using more than one tile.

rayset commented 7 years ago

you are on a commit spree :)

it works really sweet now, I believe this has potential to even surpass the original neural style in terms of quality. can't wait to explore its full potential :)