-
Notifications
You must be signed in to change notification settings - Fork 74.8k
Closed
Labels
TF 2.0Issues relating to TensorFlow 2.0Issues relating to TensorFlow 2.0comp:apisHighlevel API related issuesHighlevel API related issuesstat:awaiting responseStatus - Awaiting response from authorStatus - Awaiting response from authortype:supportSupport issuesSupport issues
Description
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): not really
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Mojave 10.14.5 (18F132)
- TensorFlow installed from (source or binary): tensorflow==2.0.0b1 from https://pypi.org/
- TensorFlow version (use command below): v2.0.0-beta0-16-g1d91213fe7 2.0.0-beta1
- Python version: Python 3.6.8
- Bazel version (if compiling from source): N/A
- GCC/Compiler version (if compiling from source): N/A
- CUDA/cuDNN version: N/A
- GPU model and memory: N/A
Describe the current behavior
A plenty of FutureWarning errors:
/xxx/venv/lib/python3.6/site-packages/tensorflow-2.0.0b1-py3.6-macosx-10.14-x86_64.egg/tensorflow/python/framework/dtypes.py:516: 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)])
/xxx/venv/lib/python3.6/site-packages/tensorflow-2.0.0b1-py3.6-macosx-10.14-x86_64.egg/tensorflow/python/framework/dtypes.py:517: 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)])
/xxx/venv/lib/python3.6/site-packages/tensorflow-2.0.0b1-py3.6-macosx-10.14-x86_64.egg/tensorflow/python/framework/dtypes.py:518: 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)])
/xxx/venv/lib/python3.6/site-packages/tensorflow-2.0.0b1-py3.6-macosx-10.14-x86_64.egg/tensorflow/python/framework/dtypes.py:519: 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)])
/xxx/venv/lib/python3.6/site-packages/tensorflow-2.0.0b1-py3.6-macosx-10.14-x86_64.egg/tensorflow/python/framework/dtypes.py:520: 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)])
/xxx/venv/lib/python3.6/site-packages/tensorflow-2.0.0b1-py3.6-macosx-10.14-x86_64.egg/tensorflow/python/framework/dtypes.py:525: 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)])
/xxx/venv/lib/python3.6/site-packages/tb_nightly-1.14.0a20190603-py3.6.egg/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)])
/xxx/venv/lib/python3.6/site-packages/tb_nightly-1.14.0a20190603-py3.6.egg/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)])
/xxx/venv/lib/python3.6/site-packages/tb_nightly-1.14.0a20190603-py3.6.egg/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)])
/xxx/venv/lib/python3.6/site-packages/tb_nightly-1.14.0a20190603-py3.6.egg/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)])
/xxx/venv/lib/python3.6/site-packages/tb_nightly-1.14.0a20190603-py3.6.egg/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)])
/xxx/venv/lib/python3.6/site-packages/tb_nightly-1.14.0a20190603-py3.6.egg/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)])
Describe the expected behavior
No warnings.
Code to reproduce the issue
import tensorflow.python.framework.dtypes
print("Hello world")
rhimanshu909, Omega97, nithinmurali, Jadiker, ccppoo and 53 morebeingmechon, rAm1n, Extarys, jxmorris12, slmatrix and 5 more
Metadata
Metadata
Assignees
Labels
TF 2.0Issues relating to TensorFlow 2.0Issues relating to TensorFlow 2.0comp:apisHighlevel API related issuesHighlevel API related issuesstat:awaiting responseStatus - Awaiting response from authorStatus - Awaiting response from authortype:supportSupport issuesSupport issues
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ravikyram commentedon Jul 8, 2019
@habernal We have executed your code in Google colab and in Jupyter notebook with TF version
2.0 beta 1 and numpy version 1.16.4.We did not get any warnings.Please upgrade your numpy version and check whether the warnings still persists.Thanks!
habernal commentedon Jul 9, 2019
Thanks, @ravikyram - I've double-checked the installed libraries and found the culprit.
TF 2.0.b1 comes with numpy dependency 1.16.4 and it shows no warning. So it is correct you couldn't reproduce the bug, neither could I.
However, it turned out that I had numpy 1.17.0rc1 installed in the project (no idea from which library it was linked as I certainly didn't install it by hand).
Numpy 1.17.0rc1 is responsible for complaining about these FutureWarnings. Perhaps not urgent to fix for now but once there is an upgrade to np 17, this will show up again, I guess.
habernal commentedon Jul 9, 2019
In fact, the numpy dependency is treated differently given the tool you install TF (
pip
versussetuptools
). Both tested in a clean virtual environment with only these libraries installed at the beginning:pip==19.1.1 setuptools==41.0.1 wheel==0.33.4
setup.py
containing only:and then installing as
They understand the requirement
numpy<2.0,>=1.14.5
differently: pip installs 1.16.4 while setuptools 1.17.0rc1.Proposed fix:
Change the dependency to
numpy<1.17,>=1.14.5
to stick with the 1.16 version regardless of the installation procedure.habernal commentedon Jul 9, 2019
And here's the core of the problem: pypa/setuptools#855
as discovered by others, too: https://stackoverflow.com/q/54796975
ravikyram commentedon Jul 10, 2019
@habernal let me know if we can close this issue since we found the solution. Thanks!
yongtang commentedon Jul 10, 2019
@habernal I think tensorflow could be updated to make it compatible with numpy 1.17+. Created a PR #30559 for the fix.
42 remaining items