【Tensorflow实战系列】Tensorflow:AssertionError: Bad argument number for Name: 3, expecting 4 (bug) 1. 问题描述LZ配置的tf环境,只要运行就会出现一堆类似上述的错误AssertionError: Bad argument number for Name: 3, expecting 4 (bug)WARNING: Entity bound method Dense.call of tensorflow.python.layers.core.Dense object at 0x7f4ab843b3c8 could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY10) and attach the full output. Cause: converting bound method Dense.call of tensorflow.python.layers.core.Dense object at 0x7f4ab843b3c8: AssertionError: Bad argument number for Name: 3, expecting 42. 解决方案因为对结果的影响不可观,所以就没去在意 ,后面发现用其他docker并没有多少问题,而且每次都出现一堆warning很影响美观性,于是百度准备解决这个问题后来发现是有个gast的库版本太高,导致不兼容的问题,降级gast即可解决使用pip或者conda进行降级pip install --user gast0.2.2 conda install gast0.2.23. 参考地址https://github.com/tensorflow/autograph/issues/1