I have no idea how to fix it. Here is my code and error:
from keras import backend as K
target_image = K.constant(preprocess_image(target_image_path))
style_reference_image = K.constant(preprocess_image(style_reference_image_path))
combination_image = K.placeholder((1, img_height, img_width, 3))
input_tensor = K.concatenate([target_image, style_reference_image, combination_image], axis=0)
model = vgg19.VGG19(input_tensor=input_tensor, weights='imagenet', include_top=False)
print('model loaded')
AttributeError Traceback (most recent call last)
<ipython-input-17-709cfab4486a> in <module>
6 combination_image = K.placeholder((1, img_height, img_width, 3))
7 input_tensor = K.concatenate([target_image, style_reference_image, combination_image], axis=0)
----> 8 model = vgg19.VGG19(input_tensor=input_tensor, weights='imagenet', include_top=False)
9 print('model loaded')
~/anaconda3/envs/tf_gpu/lib/python3.7/site-packages/keras/applications/__init__.py in wrapper(*args, **kwargs)
18 kwargs['models'] = models
19 kwargs['utils'] = utils
---> 20 return base_fun(*args, **kwargs)
21
22 return wrapper
~/anaconda3/envs/tf_gpu/lib/python3.7/site-packages/keras/applications/vgg19.py in VGG19(*args, **kwargs)
9 @keras_modules_injection
10 def VGG19(*args, **kwargs):
---> 11 return vgg19.VGG19(*args, **kwargs)
12
13
~/anaconda3/envs/tf_gpu/lib/python3.7/site-packages/keras_applications/vgg19.py in VGG19(include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs)
102 img_input = layers.Input(shape=input_shape)
103 else:
--> 104 if not backend.is_keras_tensor(input_tensor):
105 img_input = layers.Input(tensor=input_tensor, shape=input_shape)
106 else:
~/anaconda3/envs/tf_gpu/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py in is_keras_tensor(x)
693 ```
694 """
--> 695 if not is_tensor(x):
696 raise ValueError('Unexpectedly found an instance of type `' +
697 str(type(x)) + '`. '
~/anaconda3/envs/tf_gpu/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py in is_tensor(x)
701
702 def is_tensor(x):
--> 703 return isinstance(x, tf_ops._TensorLike) or tf_ops.is_dense_tensor_like(x)
704
705
AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'