2

我需要在推断后查看中间值,类似于 [这里] [1] 为 Keras 建议的值

https://keras.io/getting_started/faq/#how-can-i-obtain-the-output-of-an-intermediate-layer-feature-extraction

 model = ...  # create the original model

 layer_name = 'my_layer'
 intermediate_layer_model = keras.Model(inputs=model.input,
                                       outputs=model.get_layer(layer_name).output)
 intermediate_output = intermediate_layer_model(data) 

我在 tensor2tensor 中找不到类似的解决方案。是否可以设置一个 hparam 来在特定层切割我的模型?

4

0 回答 0