0

I am trying to work with Tensorflow Object Detection API as described here.

I did exactly what is described there, but I got the following errors:

python3 object_detection/builders/model_builder_test.py

..EE...
======================================================================
ERROR: test_create_faster_rcnn_resnet_v1_models_from_config (__main__.ModelBuilderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "object_detection/builders/model_builder_test.py", line 258, in test_create_faster_rcnn_resnet_v1_models_from_config
    for extractor_type, extractor_class in FEATURE_EXTRACTOR_MAPS.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

======================================================================
ERROR: test_create_rfcn_resnet_v1_model_from_config (__main__.ModelBuilderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "object_detection/builders/model_builder_test.py", line 448, in test_create_rfcn_resnet_v1_model_from_config
    for extractor_type, extractor_class in FEATURE_EXTRACTOR_MAPS.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

----------------------------------------------------------------------
Ran 7 tests in 0.019s

FAILED (errors=2)

Please help me to understand what's wrong there, many thanks!

1
  • Just found out that it's a non-supported method call in Python3, changed to "items()". Commented Jun 15, 2017 at 23:44

2 Answers 2

4

As you are in python3, use dict.items() instead of dict.iteritems()

iteritems() does not exist in Python 3.

Sign up to request clarification or add additional context in comments.

Comments

1

You have to use diction.items() function. An example would be:

dict = {'Name': 'Zara', 'Age': 7}
print ("Value : %s" %  dict.items())

Output:

Value : dict_items([('Name', 'Zara'), ('Age', 7)])

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.