Closed antimodular closed 8 years ago
Your compiled Theano function has a 4-dimensional tensor variable as its input placeholder, but you're passing a 3-dimensional numpy array. Convolutional layers generally expect input of (batchsize, channels, rows, cols), so if you want to pass a single image, it should be of shape (1, 3, 768, 1024). The prep_image
function in that notebook should return the correct shape, and also do another required preprocessing step (subtracting a predefined mean value that was determined before training). Do not try to bypass it!
you are right. i did comment it out.
# rawim, art = prep_image(art)
# plt.imshow(rawim)
i converted it to run as a .py script in PyCharm IDE and plt.imshow(rawim) caused some error. but now that i put rawim, art = prep_image(art) the above mentioned issues is gone.
thank you very much.
i am trying to successfully compile the style transfer example here: https://github.com/Lasagne/Recipes/blob/master/examples/styletransfer/Art%20Style%20Transfer.ipynb
installed cud on my OS X machine got through some other cudnn issues. now i am stuck at this error "'Wrong number of dimensions: expected 4, got 3 with shape (768, 1024, 3).')"
the internet things it's something about numpy misshaped array. ? thanks for any advice?