hellochick / ICNet-tensorflow

TensorFlow-based implementation of "ICNet for Real-Time Semantic Segmentation on High-Resolution Images".
406 stars 153 forks source link

AttributeError: 'dict' object has no attribute 'iteritems' #26

Closed matt-deboer closed 6 years ago

matt-deboer commented 6 years ago

When I try to run python inference.py --model=train --img-path=./input/IMG_0416_640x480.png, I get the following output:

Restore from train30k model...
Traceback (most recent call last):
  File "inference.py", line 158, in <module>
    main()
  File "inference.py", line 134, in main
    net.load(model_train30k, sess)
  File "/Users/user/workspace/cv/ICNet-tensorflow/network.py", line 71, in load
    for param_name, data in data_dict[op_name].iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

Any ideas why this might happen?

I'm running this on OSX 10.13, w/ TF 1.4.1, python 3.6

hellochick commented 6 years ago

@matt-deboer , you can change to following line:

 for param_name, data in data_dict[op_name].items():

This problem occur because of the version of python.

matt-deboer commented 6 years ago

Thanks much; that works.