Keras pre trained models with theano backend

I would like transefer some pre-trained keras theano backend but i failed i have the pretrained models from this link

https://jayanthkoushik.github.io/neural_style.html

I have tried to transfer the back end to tensorflow :-


here is code


def get_transformer_net(X, weights=None):
    input_ = Input(tensor=X, shape=(3, 256, 256))
    y = conv_layer(input_, 32, 9)
    y = conv_layer(y, 64, 3, subsample=2)
    y = conv_layer(y, 128, 3, subsample=2)
    y = residual_block(y)
    y = residual_block(y)
    y = residual_block(y)
    y = residual_block(y)
    y = residual_block(y)
    y = conv_layer(y, 64, 3, upsample=2)
    y = conv_layer(y, 32, 3, upsample=2)
    y = conv_layer(y, 3, 9, only_conv=True)
    y = Activation("tanh")(y)
    y = Lambda(lambda x: x * 150, output_shape=(3, None, None))(y)

    net = Model(input=input_, output=y)
    if weights is not None:
        try:
            net.load_weights(weights)
        except OSError as e:
            print(e)
            sys.exit(1)
    return net


this is my conversation code :



# Build transformer model.

X = theano.shared(np.array([[[[]]]
], dtype=floatX))
weights = 'wave.h5'
transformer_net = get_transformer_net(X, weights)


ops = []
for layer in transformer_net.layers:
if layer.__class__.__name__ in ['Convolution1D', 'Convolution2D', 'Convolution3D', 'AtrousConvolution2D']:
original_w = K.get_value(layer.W)
converted_w = convert_kernel(original_w)
ops.append(tf.assign(layer.W, converted_w).op)


K.get_session().run(ops)


model.save_weights('my_weights_tensorflow.h5')


the error i get is this :


Traceback (most recent call last):
File "convert_theano_tensorFlow.py", line 26, in <module>
transformer_net = get_transformer_net(X, weights)
File "CoreMl/neural-style/neural_style/fast_neural_style/transformer_net.py", line 81, in get_transformer_net
y = conv_layer(input_, 32, 9)
File "CoreMl/neural-style/neural_style/fast_neural_style/transformer_net.py", line 65, in conv_layer
out = ReflectPadding2D((padding, padding))(out)
File "/usr/local/lib/python3.5/dist-packages/Keras-2.0.8-py3.5.egg/keras/engine/topology.py", line 558, in __call__
File "/usr/local/lib/python3.5/dist-packages/Keras-2.0.8-py3.5.egg/keras/engine/topology.py", line 431, in assert_input_compatibility
ValueError: Layer reflect_padding2d_1 was called with an input that isn't a symbolic tensor. Received type: <class 'theano.tensor.sharedvar.TensorSharedVariable'>. Full input: [<TensorType(float64, 4D)>]. All inputs to the layer should be tensors.



is there any solution to transfer theano backend preconfigured models to coreml



any suggestion , and thanks in advance

Keras pre trained models with theano backend
 
 
Q