"순수한"TensorFlow에서 Keras의 모델을 사용하려고합니다 (Android 앱에서 사용하고 싶습니다). Keras 모델을 protobuf에 성공적으로 내보내고 Tensorflow로 가져 왔습니다. 그러나 실행중인 텐서 흐름 모델은 입력 및 출력 텐서 이름을 제공해야하며이를 찾는 방법을 모른다. 내 모델은 다음과 같습니다 : 나는 TensorFlow에 텐서를 인쇄하는있을 때 Keras 모델을 TensorFlow에로드 할 때 입력 및 출력 텐서 이름
seq = Sequential()
seq.add(Convolution2D(32, 3, 3, input_shape=(3, 15, 15), name="Conv1"))
....
seq.add(Activation('softmax', name="Act4"))
seq.compile()
내가 찾을 수 있습니다
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, 모양 (3,15,15)가 더 텐서가 없습니다.
은 내가 입력으로 "my_input_tensor"를 추가 할 수 here을 본 적이 나도 몰라 hovewer는 유형이있다 - 나는 TensorFlow의 및 Keras '자리를 시도하고 그들은 나에게이 오류 준 :
/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[0].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'
을