FutureWarning: Conversión del segundo argumento de issubdtype de `float` a `np.flotante " está en desuso


Después de actualizar mi Numpy y Tensorflow estoy recibiendo este tipo de advertencias. Ya había probado estos, pero nada funciona, cada sugerencia será apreciada.

FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2018-01-19 17:11:38.695932: I C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
Author: Olivier Moindrot, 2018-01-19

9 answers

Había intentado con estos y se había resuelto el mismo problema para mí , solo poner estos en la parte superior de su código

import os
os.environ["TF_CPP_MIN_LOG_LEVEL"]="3"
 15
Author: raja,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-31 14:31:48

Este podría o no ser su caso, pero la misma advertencia también se escupió de h5py paquete:

/home/user/bin/conda3/lib/python3.6/site-packages/h5py/__init__.py:34: FutureWarning: Conversión del segundo argumento de issubdtype desde float a np.floating está en desuso. En el futuro, se tratará as np.float64 == np.dtype(float).type. de ._conv de importación register_converters as _register_converters

Para cualquiera que venga aquí con este problema, es un problema h5py conocido, introducido con numpy 1.14. Como dicho por los desarrolladores:

Puede ignorar la advertencia, no va a causar ningún problema en el momento, pero usted debe actualizar a la próxima versión de h5py cuando se está disponible.

... así que es inofensivo. La solución acaba de ser fusionada a master. Pero hasta que se publique la actualización, la solución es degradar numpy a una versión anterior:

pip install numpy==1.13.0

Actualizar: h5py ha lanzado la compilación RC con la corrección. Los siguientes comando debe hacerlo:

pip install h5py==2.8.0rc1
 47
Author: Maxim,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-23 19:32:36

Podría actualizar h5py

sudo pip3 install h5py==2.8.0rc1
 15
Author: Claude COULOMBE,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-18 03:01:08

También puede usar el siguiente código para borrar las líneas de advertencia del terminal utilizando las siguientes líneas al principio de su código.

Código Con advertencia:

import numpy as np, sys, tensorflow as tf print('\nStart of Code...\n')

Salida:

FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters

Start of Code...

Código con Advertencia Borrada:

import numpy as np, sys, tensorflow as tf for i in range(3): # Add this for loop. sys.stdout.write('\033[F') # Back to previous line. sys.stdout.write('\033[K') # Clear line.

print('\nStart of Code...\n')

Salida:

Start of Code...

 4
Author: Arindam,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-02-12 16:07:47

Anteriormente estaba recibiendo el mismo error , solo había usado el módulo warnings (). Yo había utilizado estos códigos después de todas sus importaciones,

import warnings
warnings.filterwarnings('ignore', '.*do not.*',)
 3
Author: Harshit Gyan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-28 13:11:28

Actualice scipy a rif de esta advertencia. Para hacer esto, puede usar pip para actualizar scipy.

**sudo pip install --upgrade scipy**
 2
Author: Mohammad Mohsin Reza,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-13 19:48:56

Esto se debe a un conflicto de versiones entre h5py y numpy. Todo lo que necesita hacer es degradar su versión numpy a través del comando de la siguiente manera:

pip install numpy==1.13.0
 2
Author: Taylor Mei,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-27 02:04:35

Nada de lo anterior funcionó en mi caso y no quería degradar ningún paquete.

Hay una solución sencilla en Github , simplemente suprima la advertencia:

import warnings
with warnings.catch_warnings():
    warnings.filterwarnings("ignore",category=FutureWarning)
    import numpy as np
    import tensorflow as tf
    import h5py as h5py

Y luego importar el paquete que causa el error (numpy, tensorflow, h5py) dentro del ámbito de la declaración with

 2
Author: dopexxx,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-02 12:25:03

Solucioné este problema instalando/reinstalando ipykernel:

pip3 install --upgrade ipykernel

Si usted tiene diferente pip por supuesto nosotros que uno

 1
Author: Arvin Amir,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-22 00:19:03