in ()
----> 1 _=deepdream(net, img)
in deepdream(net, base_img, iter_n, octave_n, octave_scale, end, clip, *_step_params)
1 def deepdream(net, base_img, iter_n=10, octave_n=4, octave_scale=1.4, end='inception_4c/output', clip=True, *_step_params):
2 # prepare base images for all octaves
----> 3 octaves = [preprocess(net, base_img)]
4 for i in xrange(octave_n-1):
5 octaves.append(nd.zoom(octaves[-1], (1, 1.0/octave_scale,1.0/octave_scale), order=1))
in preprocess(net, img)
16 # a couple of utility functions for converting to and from Caffe's input image layout
17 def preprocess(net, img):
---> 18 return np.float32(np.rollaxis(img, 2)[::-1]) - net.transformer.mean['data']
19 def deprocess(net, img):
20 return np.dstack((img + net.transformer.mean['data'])[::-1])
ValueError: operands could not be broadcast together with shapes (4,602,915) (3,1,1)
I am trying to figure what to do !
In [6]:
_=deepdream(net, img)
ValueError Traceback (most recent call last)