我是靠谱客的博主 冷静豌豆,这篇文章主要介绍python整形不可迭代_Python Tensorflow NoneType不可迭代,现在分享给大家,希望可以做个参考。

完整代码是

here

---------------------------------------------------------------------------

TypeError Traceback (most recent call last)

in ()

55 print(Feed_dict)

56 _,loss_val = sess.run(tr_op,---> 57 Feed_dict=Feed_dict)

58 print('Loss of the current batch is {}'.format(loss_val))

TypeError: 'NoneType' object is not iterable

在执行该调用之前运行以下代码:

print(type(tr_op))

print(type(Feed_dict))

try:

some_object_iterator = iter(Feed_dict)

except TypeError as te:

print (Feed_dict,'is not iterable')

print(Feed_dict)

产生输出:

{: array([[[[0.3019608,0.23921569,0.58431375],[0.30588236,0.61960787],[0.30980393,0.24705882,0.63529414],...,

因此,应该可迭代的对象显然是可迭代的,因为当我尝试从中创建迭代器时它不会引发异常,并且两个对象都具有明确定义的类型.此错误不在会话的TensorFlow文件中,我不知道它被引发的位置,因为没有跟踪.

谢谢你的帮助

最后

以上就是冷静豌豆最近收集整理的关于python整形不可迭代_Python Tensorflow NoneType不可迭代的全部内容,更多相关python整形不可迭代_Python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(109)

评论列表共有 0 条评论

立即
投稿
返回
顶部