Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress "Future warning" tensorflow?

I am running "./buildTF.sh" which uses TensorFlow, on ubuntu terminal. And getting the error as:

/usr/local/lib/python3.6/dist-packages/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'.
like image 381
Praveen Pareek Avatar asked Dec 10 '22 02:12

Praveen Pareek


2 Answers

These warnings are classical FutureWarning, which means you can silent them using the warnings module from the python standard library:

import warnings
warnings.filterwarnings("ignore", message=r"Passing", category=FutureWarning)

This will check FutureWarning and silent the messages containing r"Passing".

like image 102
tupui Avatar answered Dec 12 '22 16:12

tupui


This is a warning message which comes because of numpy version, uninstall the current numpy version and update it to 1.16.4.

# pip uninstall numpy 
# pip install numpy==1.16.4

Thanks to ymodak

like image 24
PC_11 Avatar answered Dec 12 '22 15:12

PC_11