titu1994 / Neural-Style-Transfer

Keras Implementation of Neural Style Transfer from the paper "A Neural Algorithm of Artistic Style" (http://arxiv.org/abs/1508.06576) in Keras 2.0+
Apache License 2.0
2.27k stars 482 forks source link

Error with line 316 of Network.py #34

Closed nateburley closed 7 years ago

nateburley commented 7 years ago

Hey, I'm trying to run your style transfer code, but I keep getting an error with line 316 in Network.py . I have keras 1.2.2. Here's what I'm running in the terminal (base image, style image, and output directory):

$python Network.py ~/Desktop/orange_wall.jpg ~/Desktop/picasso_blue-nude.jpg ~/Desktop/PracticeOutput/

And here's the error: Traceback (most recent call last): File "Network.py", line 316, in <module> x = Convolution2D(64, (3, 3), activation='relu', name='conv1_1', padding='same')(ip) TypeError: __init__() takes at least 4 arguments (4 given)

Can anyone help me out? @titu1994

titu1994 commented 7 years ago

Update to Keras 2. The repository scripts no longer work with Keras 1.

nateburley commented 7 years ago

I now have Keras 2.0.5, but now when I run the same command, I get this error: File "Network.py", line 316, in <module> x = Convolution2D(64, (3, 3), activation='relu', name='conv1_1', padding='same')(ip) File "/anaconda/lib/python2.7/site-packages/keras/engine/topology.py", line 615, in __call__ output_shape = self.compute_output_shape(input_shape) File "/anaconda/lib/python2.7/site-packages/keras/layers/convolutional.py", line 191, in compute_output_shape self.kernel_size[i], IndexError: tuple index out of range

@titu1994

titu1994 commented 7 years ago

Fixed via 6a27fc3b53b98f5767ba18f6b375e54d57cf274d