Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'keys' #310

Closed
effdotsh opened this issue Jun 4, 2019 · 4 comments
Closed

AttributeError: 'NoneType' object has no attribute 'keys' #310

effdotsh opened this issue Jun 4, 2019 · 4 comments
Assignees

Comments

@effdotsh
Copy link

effdotsh commented Jun 4, 2019

~/Desktop/tensorflow_image_classifier-master/Code$ python retrain.py --image_dir ~/flower_photos
WARNING: Logging before flag parsing goes to stderr.
W0603 21:21:06.534612 140672247924544 deprecation_wrapper.py:119] From retrain.py:1346: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

W0603 21:21:06.535128 140672247924544 deprecation_wrapper.py:119] From retrain.py:979: The name tf.logging.FATAL is deprecated. Please use tf.compat.v1.logging.FATAL instead.

W0603 21:21:06.535294 140672247924544 deprecation_wrapper.py:119] From retrain.py:980: The name tf.logging.ERROR is deprecated. Please use tf.compat.v1.logging.ERROR instead.

W0603 21:21:06.535449 140672247924544 deprecation_wrapper.py:119] From retrain.py:981: The name tf.logging.WARN is deprecated. Please use tf.compat.v1.logging.WARN instead.

W0603 21:21:06.535599 140672247924544 deprecation_wrapper.py:119] From retrain.py:982: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

W0603 21:21:06.535734 140672247924544 deprecation_wrapper.py:119] From retrain.py:983: The name tf.logging.DEBUG is deprecated. Please use tf.compat.v1.logging.DEBUG instead.

W0603 21:21:06.535892 140672247924544 deprecation_wrapper.py:119] From retrain.py:918: The name tf.gfile.Exists is deprecated. Please use tf.io.gfile.exists instead.

W0603 21:21:06.536046 140672247924544 deprecation_wrapper.py:119] From retrain.py:919: The name tf.gfile.DeleteRecursively is deprecated. Please use tf.io.gfile.rmtree instead.

W0603 21:21:06.827493 140672247924544 deprecation_wrapper.py:119] From retrain.py:920: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead.

E0603 21:21:06.827811 140672247924544 retrain.py:165] Image directory '/home/ai/flower_photos' not found.
Traceback (most recent call last):
  File "retrain.py", line 1346, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
  File "/home/ai/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/home/ai/.local/lib/python2.7/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/ai/.local/lib/python2.7/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "retrain.py", line 1009, in main
    class_count = len(image_lists.keys())
AttributeError: 'NoneType' object has no attribute 'keys'

Please help, thank you.

@gowthamkpr gowthamkpr self-assigned this Jun 4, 2019
@gowthamkpr
Copy link

gowthamkpr commented Jun 4, 2019

@AI-Spawn Can you please take a look at the issues in github #1, #2 and stack overflow and let me know if that helps. Thanks!

@effdotsh
Copy link
Author

effdotsh commented Jun 5, 2019

@Gowtham-kp Thank you for your reply, retesting now :)

@effdotsh
Copy link
Author

effdotsh commented Jun 5, 2019

It Works, thanks.

@effdotsh effdotsh closed this as completed Jun 5, 2019
@Jagisha
Copy link

Jagisha commented May 2, 2021

@gowthamkpr @AI-Spawn where I have to add this pls tell me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants