I'm trying to use Keras' model in "pure" TensorFlow (I want to use it in Android app). I've successfully exported Keras model to protobuf and imported it to Tensorflow. However running tensorflow model requires providing input and output tensors' names and I don't know how to find them. My model looks like this:
seq = Sequential() seq.add(Convolution2D(32, 3, 3, input_shape=(3, 15, 15), name="Conv1")) .... seq.add(Activation('softmax', name="Act4")) seq.compile()
When I'm printing tensors in TensorFlow I can find:
Tensor("Conv1_W/initial_value:0", shape=(32, 3, 3, 3), dtype=float32) Tensor("Conv1_W:0", dtype=float32_ref) Tensor("Conv1_W/Assign:0", shape=(32, 3, 3, 3), dtype=float32_ref) Tensor("Conv1_W/read:0", dtype=float32) Tensor("Act4_sample_weights:0", dtype=float32) Tensor("Act4_target:0", dtype=float32)
Hovewer, there are no tensors that have shape (3,15,15).
I've seen here that I can add "my_input_tensor" as input, hovewer I don't know which type is it - I've tried TensorFlow's and Keras' placeholders and they gave me this error:
/XXXXXXXXX/lib/python2.7/site-packages/keras/engine/topology.pyc in __init__(self, input, output, name) 1599 # check that x is an input tensor 1600 layer, node_index, tensor_index = x._keras_history -> 1601 if len(layer.inbound_nodes) > 1 or (layer.inbound_nodes and layer.inbound_nodes.inbound_layers): 1602 cls_name = self.__class__.__name__ 1603 warnings.warn(cls_name + ' inputs must come from ' AttributeError: 'NoneType' object has no attribute 'inbound_nodes'