bert4keras
bert4keras copied to clipboard
'Tensor' object has no attribute '_keras_history'
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 没有
于是改成如下的方式:

能跑起来,但请问苏神这种方法是否也可行,感谢苏神
可以的。search_layer应当逐渐被抛弃~