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
FutureWarning: Deprecated numpy API calls in tf.python.framework.dtypes #30427
Comments
@habernal We have executed your code in Google colab and in Jupyter notebook with TF version |
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. |
In fact, the numpy dependency is treated differently given the tool you install TF (
and then installing as
They understand the requirement Proposed fix: Change the dependency to |
And here's the core of the problem: pypa/setuptools#855 as discovered by others, too: https://stackoverflow.com/q/54796975 |
@habernal let me know if we can close this issue since we found the solution. Thanks! |
Hello i am having the same error. Can u plese tell me what to do with instruction to solve this problem.Thanks |
@Akeaakar The issue has been fixed and merged into the master branch. In the next release of TF the issue should be gone. |
@Akeaakar And for the time being, |
With Ubuntu19.04, the combination of tensorflow-gpu 1.14.0 (or tensorflow-gpu 1.12.2) with numpy 1.17.0 has the same warnings as well. When change numpy version to 1.16.3, the warnings are gone. |
This commit integrates upstream changes into TensorBoard’s `tensorflow_stub` to resolve a deprecation warning in recent release candidates for NumPy. Upstream bug: <tensorflow/tensorflow#30427> Upstream fix: <tensorflow/tensorflow#30559>
Or you can supress the warnings using the below code.
|
seems this doesn't work for me. (numpy1.17.0 python3.7.3) |
Needs to be before the import, since that is where the warnings are coming from. Also added a restriction to only effect that warning category instead of silencing all warnings. |
|
I have numpy in ./venv/lib/python3.7/site-packages (1.17.2). In both Jupyter and VS Code, I get the idea. I really dislike the idea of ignoring the warning. Any fixes would be greatly appreciated. |
After doing that, system installed |
numpy: Upgrade your numpy and install keras by using the above command in Anaconda prompt. |
Hi, for reference, I got this fixed with these 2 version:
09/24/19, hope this helps |
Thanks @Namburger . The warnings are gone on 2.0.0-rc1. |
With the latest release of tensorflow (i.e., 2.0.0) and numpy 1.17.2, the warning is back. |
Can you provide a reproducer, @UndeadKernel ? I cannot reproduce:
Also tried from a file: import tensorflow as tf
import numpy as np
print("TF", tf.__version__)
print("NP", np.__version__)
import tensorflow.python.framework.dtypes but no warnings:
|
@mihaimaruseac, I can reproduce the problem with both examples of yours. That is, I see the following output:
I'm using arch. Arch, if I recall correctly, adapts Tensorflow to work with Python 3.7.4. Or is this version of Python already supported by Tensorflow? |
@UndeadKernel I'm running Arch too, but I'm not getting any warnings as of now (they were present earlier). My packages are:
|
This is indeed quite strange @rharish101, I have the same exact versions. I tried using |
@UndeadKernel Could you try reinstalling the TensorFlow package? It might have changed in the latest patch (2.0.0-2 as opposed to 2.0.0-1). I remember that I, too, saw those warnings in the last few days, but as of today, they are gone, with the only difference that I updated TensorFlow 9 days ago. |
@rharish101, thank for the suggestion. |
There is an official release of 2.0, you should not need to use the patched versions. |
To which patches are you referring @mihaimaruseac? |
2.0.0-1 and 2.0.0-2 mentioned in above comments
|
As a test, only suppressing single import of Keras (and hence TF backend) that occurs when importing conf directly. Reference: tensorflow/tensorflow#30427
try pip3 [pip] install tf-nightly the nightly build of tensorflow seems to have that problem sorted out, best of luck |
for I don't get the error/warning. You can try as:
|
And also for anaconda: |
After how many hours this was the one that solved my problem. I installed the TF that had the numpy version installed (18.0) and when i reverted it to 1.16.4 it works! thanks |
System information
Describe the current behavior
A plenty of FutureWarning errors:
Describe the expected behavior
No warnings.
Code to reproduce the issue
The text was updated successfully, but these errors were encountered: