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.26k stars 481 forks source link

Colab Error #60

Closed floAr closed 5 years ago

floAr commented 5 years ago

Error when running the vanilla colab from the page:

Using TensorFlow backend.
Traceback (most recent call last):
  File "Neural-Style-Transfer/INetwork.py", line 301, in <module>
    base_image = K.variable(preprocess_image(base_image_path, True, read_mode=read_mode))
  File "Neural-Style-Transfer/INetwork.py", line 218, in preprocess_image
    if K.image_dim_ordering() == "th":
AttributeError: module 'keras.backend' has no attribute 'image_dim_ordering'
titu1994 commented 5 years ago

This should be fixed via f7bd07597f6a1042170ad9a1e1f932682a22ef5e

Can you try it out?

floAr commented 5 years ago

Nope, you missed it at line 462:

Traceback (most recent call last):
  File "Neural-Style-Transfer/INetwork.py", line 521, in <module>
    loss = loss + total_variation_weight * total_variation_loss(combination_image)
  File "Neural-Style-Transfer/INetwork.py", line 462, in total_variation_loss
    if K.image_dim_ordering() == 'th':
AttributeError: module 'keras.backend' has no attribute 'image_dim_ordering'
titu1994 commented 5 years ago

Hmm github edits are difficult. Ok can you try now?

floAr commented 5 years ago

Works like a charm. Thanks!

titu1994 commented 5 years ago

Good to hear.