gpt4 book ai didi

python - 类型错误 : 'map' object is not reversible

转载 作者:太空宇宙 更新时间:2023-11-03 10:51:46 32 4
gpt4 key购买 nike

我花了将近 2 个小时来使用来自 weights.npz 的预训练模型 (tensorflow)用于检测车牌,但我无法修复它。我收到此错误消息,我以前从未见过。那么,如何解决呢?

Traceback (most recent call last): File "./detect.py", line 189, in pt1 = tuple(reversed(map(int, pt1))) TypeError: 'map' object is not reversible

最佳答案

在 python3 中,map返回一个迭代器,而不是列表。您需要使用 list 构造函数包装对 map() 的调用:

pt1 = tuple(reversed(list(map(int, pt1))))

查看更多:Getting a map() to return a list in Python 3.x

关于python - 类型错误 : 'map' object is not reversible,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48890276/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com