Skip to content

tensorflow + numpy compatibility? #31249

@jiapei100

Description

@jiapei100
~ pip show tensorflow
pipName: tensorflow
Version: 1.14.0~ pip show numpy
Name: numpy
Version: 1.17.0
>>> import tensorflow as tf
~/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
~/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
~/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
~/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
~/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
~/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

Activity

ymodak

ymodak commented on Aug 1, 2019

@ymodak
Contributor

Do you have multiple versions of numpy installed in your system?
pip show numpy
Can you uninstall all numpy versions and later install numpy==1.16.4?
pip uninstall numpy (till you uninstall all versions)
pip install numpy==1.16.4

jiapei100

jiapei100 commented on Aug 1, 2019

@jiapei100
Author

@ymodak

I manually upgraded numpy:

pip install -U numpy --user

to ~/.local/lib/python3.7/site-packages

And, yes, I happened to notice I've got python3-numpy installed as well, from Ubuntu repository.

Did tensorflow find python3-nump from repository and had it installed automatically? I specified PYTHONPATH to ~/.lcoal/lib/python3/site-packages already.

Cheers

anjakuchenbecker

anjakuchenbecker commented on Aug 2, 2019

@anjakuchenbecker

@ymodak :
Same issue for me after fresh python and tensorflow installation (tensorflow 1.14.0 and numpy 1.17.0) from today morning.
had only one numpy installation. but after uninstallation of 1.17.0 and installation of 1.16.4 the Future Warnings are gone. Thank you!

gadagashwini-zz

gadagashwini-zz commented on Aug 2, 2019

@gadagashwini-zz
Contributor

@jiapei100 Can you please let us know if you are happy to close if no issue persists. Thanks!

vrsheen

vrsheen commented on Aug 4, 2019

@vrsheen

For me the warning got resolved after doing the below 2:

  1. pip install scikit-learn

  2. pip install tensorflow-datasets

fatemehtorki

fatemehtorki commented on Aug 4, 2019

@fatemehtorki

@ymodak
Same issue happened to me with (tensorflow 1.9.0 and numpy 1.17.0)
after uninstall of 1.17.0 and installation of 1.16.4 the Future Warnings are gone. Thank you so much!

Can you help me for solve another issue?
after i load model ,when i predicted this error is occur (Tensor Tensor("dense_2/Softmax:0", shape=(?, 2), dtype=float32) is not an element of this graph) .
What do you think I should do...

IanQS

IanQS commented on Aug 5, 2019

@IanQS

@fatemehtorki

You should open a new issue for that error since it is unrelated to this error

pedro-w

pedro-w commented on Aug 5, 2019

@pedro-w

Please can you advise, it it the intention to update Tensorflow 1.x so that these warnings won't occur in numpy 1.17 and later? Or will we always have to stick at 1.16.4?

mihaimaruseac

mihaimaruseac commented on Aug 5, 2019

@mihaimaruseac
Collaborator

See #30559 Next release will have the issue solved

sudonto

sudonto commented on Aug 7, 2019

@sudonto

@fatemehtorki
You may ask in stackoverflow for that

19 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jiapei100@mihaimaruseac@eric-wieser@DanyEle@IanQS

      Issue actions

        tensorflow + numpy compatibility? · Issue #31249 · tensorflow/tensorflow