AttributeError: ‘Tensor’ object has no attribute ‘_keras_shape’
试过的方法:
1 updated Keras
对我没有用!!!我尝试了卸载Keras pip uninstall Keras
卸载了重装pip install keras -U
、updatedupdated keras to 2.2.4
,都没有用,建议如果keras和tf环境匹配的话,慎用!!
2 参考链接
https://stackoverflow.com/questions/54614299/tensor-object-has-no-attribute-keras-shape
(自行参考吧)然鹅并没有解决我的问题。。。
(这么小的问题困扰了我一早上,头大。。。)
3 _keras_shape换成_shape_val即可
最后尝试 _keras_shape换成_shape_val,完美解决问题!