解决方案:
如果使用的是keras ,
请保留
if node_key in model._container_nodes:
如何是从tf.keras.leyers 导出的:
那么按如下修改
Fix to tensorflow#17633***(https://github.com/tensorflow/tensorflow/issues/17633)***
‘Model’ object has no attribute ‘_container_nodes’ error when using tf.keras.utils.plot_model().
Replaced
if node_key in model._container_nodes:
with
if node_key in model._network_nodes: # pylint: disable=protected-access
in tensorflow\python\keras_impl\keras\utils\vis_utils.py.
本文解决了使用tf.keras.utils.plot_model()时遇到的'Model' object has no attribute '_container_nodes'错误。通过替换代码中的一行,即可成功绘制模型结构。
1867

被折叠的 条评论
为什么被折叠?



