目前我正在做一个seq2sql项目,我被困在这个项目中波纹管台阶是我的密码。在
inputs2=Input(shape=(C,3,100),name='col_tok')
col_lstm_layer=Bidirectional(LSTM(40,return_sequences=False),name='ColENC')
Col_last_hidden=tf.map_fn(lambda x:col_lstm_layer(x),
inputs2)
在 inputs2是一个四维张量,我想为inputs2中的每个元素调用col_lsm_layer。在
^{pr2}$我知道错误的答案是添加一个lambda函数,但是如何正确地执行它
Col_last_hidden=tf.map_fn(lambda x:col_lstm_layer(lambda:x),
inputs2)
但它给出了流动误差。在
Unexpectedly found an instance of type `<class 'function'>`. Expected a symbolic tensor instance.
During handling of the above exception, another exception occurred:
在 那么,如何迭代一个四维张量并将三维张量传递给lstm层呢?请帮帮我。在
目前没有回答
相关问题 更多 >
编程相关推荐