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

Deprecation notice for collection.Sequence in recurrent.py #35892

Closed
ulf1 opened this issue Jan 15, 2020 · 3 comments
Closed

Deprecation notice for collection.Sequence in recurrent.py #35892

ulf1 opened this issue Jan 15, 2020 · 3 comments
Assignees
Labels
comp:keras Keras related issues type:bug Bug

Comments

@ulf1
Copy link

ulf1 commented Jan 15, 2020

@qlzh727

Describe the current behavior

When running unit tests the following deprecation note appears

lib/python3.7/site-packages/tensorflow_core/python/keras/layers/recurrent.py:808: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
  if (isinstance(inputs, collections.Sequence)

Describe the expected behavior

No deprecation notice

Line 808 needs a minor modification

...
  if (isinstance(inputs, collections.abc.Sequence)
...

See python 3 docs

@qlzh727
Copy link
Member

qlzh727 commented Jan 17, 2020

Since we still have to support py2 within Google for now, we can't migrate to py3 only code yet.

@qlzh727 qlzh727 closed this as completed Jan 17, 2020
@tensorflow-bot
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@bjourne
Copy link

bjourne commented Jul 8, 2020

Looks like this has been fixed the proper way now:

try:
  from collections import abc as collections_abc  # pylint: disable=g-import-not-at-top
except ImportError:  # For Python 2
  import collections as collections_abc  # pylint: disable=g-import-not-at-top

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:keras Keras related issues type:bug Bug
Projects
None yet
Development

No branches or pull requests

4 participants