我在运行tf.app.run的时候出现AttributeError: module ‘main’ has no attribute ‘main’的错误,网上没有查到有用的资料,但是看到默认传递的是main()函数,可能是这个出现了错误,因此我把main()函数换成了其他名字go()。
并且将go()送入run中,即 tf.app.run(go()),就避免这个问题了。
tf.app.run出现错误AttributeError: module '__main__' has no attribute 'main'
最新推荐文章于 2026-06-25 14:11:04 发布
在使用tf.app.run时遇到AttributeError,通过更改main函数名称并传入其他函数名解决问题。
353

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



