Seite 1 von 1

tensorflow warning

Verfasst: Samstag 17. August 2019, 12:36
von toper
Hallo zusammen,
ich habe tensorflow installiert und ein programm laufen lassen

Code: Alles auswählen

import tensorflow as tf 
from tensorflow import keras

model = keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])]) 

model.compile(optimizer='sgd', loss='mean_squared_error') 


xs=[1, 2, 3] 
ys=[2, 4, 6] 

model.fit(xs, ys, epochs=1000) 

print(model.predict([7])) 
Das Programm funktioniert, allerdings werden am Anfang des Programms fehlermeldungen ausgegeben
Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py", line 516
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py", line 517
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py", line 518
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py", line 519
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py", line 520
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py", line 525
np_resource = np.dtype([("resource", np.ubyte, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py", line 541
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py", line 542
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py", line 543
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py", line 544
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py", line 545
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
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'.

Warning (from warnings module):
File "C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py", line 550
np_resource = np.dtype([("resource", np.ubyte, 1)])
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'.
WARNING: Logging before flag parsing goes to stderr.
W0817 13:27:10.047008 4644 deprecation.py:506] From C:\Users\Tobias_Arbeit\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\ops\init_ops.py:1251: calling VarianceScaling.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
Weiß jemand was diese Meldungen bedeuten?
Und ist es ein Problem(also schränkt es die Funktion von tensorflow irgendwie ein) oder kann man sie ignorieren?
Wenn ja, kann man sie irgendwie ausblenden?

Re: tensorflow warning

Verfasst: Samstag 17. August 2019, 12:52
von __blackjack__
@toper: Zum Unterdrücken von Warnungen nach verschiedenen Kriterien steht etwas in der Dokumentation zum `warnings`-Modul.

Re: tensorflow warning

Verfasst: Samstag 17. August 2019, 12:56
von toper
@_blackjack_: Ich habe bereits nach solchen befehlen gesucht aber nichts gefunden.
Mein eigendliches problem liegt auch darin dass ich nicht weiß ob ich durch diese Fehlermeldungen irgendwelche funktionen nicht nutzen kann!

Re: tensorflow warning

Verfasst: Samstag 17. August 2019, 14:30
von __deets__
Nein, nur wird dein Code in zukünftigen Versionen nicht mehr tun. Und was man gegen die Warnung unternehmen kann (statt sie zu ignorieren/unterdrücken) steht in der Warnung selbst.

Re: tensorflow warning

Verfasst: Samstag 17. August 2019, 16:11
von __blackjack__
@toper: Wie gesucht und nicht gefunden? Nicht irgendwo im Netz mit einer Suchmaschine suchen, sondern einfach die Dokumentation zum `warnings`-Modul aus der Python-Standardbibliothek lesen.