'dict' object has no attribute 'iterkeys'这个错误意味着你尝试在一个Python字典对象上调用iterkeys方法,但是这个方法在Python 3中并不存在。在Python 2中,iterkeys方法用于返回一个字典键的迭代器,但在Python 3中,这个方法已经被移除。 2. 说明Python 3中字典对象的正确迭代方法 在Python 3中,如果你想要迭代字典...
for key in net.params.iterkeys(): if type(net.params[key]) is caffe._caffe.BlobVec: print(key) python3中用keys()代替python2中的iterkeys(),同理还有iteritems等,都需要去掉iter前缀。 解决方法: for key in net.params.keys(): if type(net.params[key]) is caffe._caffe.BlobVec: print(key...
AttributeError: 'dict' object has no attribute 'iterkeys' J-Holliday commented Jul 15, 2017 I got the same error in the same environment... JBH168 commented Jul 15, 2017 That's cause there is no iterkeys() for dictionaries in Python 3. See: http://legacy.python.org/dev/peps/pep-...