bert4keras icon indicating copy to clipboard operation
bert4keras copied to clipboard

'Tensor' object has no attribute '_keras_history'

Open Lufffya opened this issue 4 years ago • 1 comments

windows下使用 tf.keras,tf== 2.4.0 运行 task_iflytek_gradient_penalty 的例子 当调用 search_layer 函数遇到错误:'Tensor' object has no attribute '_keras_history'

后来发现是 _keras_history 是keras tensor特有的属性,tf tensor 没有 于是改成如下的方式: image

能跑起来,但请问苏神这种方法是否也可行,感谢苏神

Lufffya avatar Jan 13 '22 06:01 Lufffya

可以的。search_layer应当逐渐被抛弃~

bojone avatar Feb 02 '22 14:02 bojone