ryankennedyio / deep-dream-generator

#deepdream in a docker environment, to save you 8 hours of setup headaches.
196 stars 53 forks source link

ValueError: operands could not be broadcast together with shapes (4,602,915) (3,1,1) #8

Closed julien2512 closed 9 years ago

julien2512 commented 9 years ago

In [6]:

_=deepdream(net, img)


ValueError Traceback (most recent call last)

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 !
julien2512 commented 9 years ago

I got it, It was the sample image to be changed !

Still calculating indeed ... I guess a smaller image would make it.

julien2512 commented 9 years ago

I got it, It was the image sample to be changed.