tf.keras.Model获取输出tensor name
1.从keras.Model获取output name
from tensorflow.python.keras.saving import saving_utils function = saving_utils.trace_model_call(model) concrete_func = function.get_concrete_function() print(concrete_func.structured_outputs) print(concrete_func.structured_input_signature) #或者 input_names = [input_tensor.name for input_tensor in concrete_func.inputs if input_tensor.dtype != tf.dtypes.resource] print(input_names)