2017-11-22 5 views
1

Ich bin mir nicht sicher, ob die Art, wie ich den Tensorflow auf meinem Laptop installiert habe, korrekt ist oder nicht und immer noch versuche, einige der Probleme herauszufinden.Tensorflow Binärer Fehler Python vs Go

Anfangs habe ich Tensorflow auf meinem Mac-Buchpro installiert und habe kein Glück dort (wird später dazu kommen), dann habe ich auf einer Vagrant-Box mit einem Ubuntu 16.04-Image installiert.

(tensorflow) [email protected]:~$ python 
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import tensorflow 
>>> import tensorflow as tf 
>>> hello = tf.constant('Hello, TensorFlow!') 
>>> sess = tf.Session() 
>>> print(sess.run(hello)) 
Hello, TensorFlow! 
>>> 
(tensorflow) [email protected]:~$ go run testing_tensor.go 
2017-11-22 15:50:43.747754: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX 
Hello from TensorFlow version 1.4.0 

Nicht sicher, wie unterschiedlich das ist eine Python-Bibliothek verwenden, und Bibliothek gehen und wie kann ich feststellen, ob die tensorflow der CPU statt gpu verwendet?

Antwort

0

TensorFlow werden Ihnen sagen, welches Gerät eine Sitzung mit, wenn Sie die Sitzung mit der log_device_placement Option auf true gesetzt erstellen:

conf = tf.ConfigProto(log_device_placement=True) 
sess = tf.Session(config=conf) 
print(sess.run(hello)) 
+0

Hallo ich folgende, wenn ich den obigen Code versucht, '>>> hallo = tf.constant ('Hallo, Tensorflow!') >>> conf = tf.ConfigProto (log_device_placement = Wahr) >>> sess = tf.Session (config = conf) Gerätezuordnung: keine bekannten Geräte. 2017-11-22 19: 19: 26.655582: Ich Tensorfluss/Kern/common_runtime/direct_session.cc: 299] Gerätezuordnung: >>> print (sess.run (hallo)) ' – kgrvamsi

+0

Das sagt Ihnen, dass die Sitzung läuft auf der CPU, nicht auf der GPU. Sie können überprüfen, ob TensorFlow die GPU kennt, indem Sie 'device_lib.list_local_devices()' aufrufen. Aber zuerst müssen Sie 'device_lib' mit' from tensorflow.python.client import device_lib' importieren. – MatthewScarpino

+0

Ich versuchte es und ich bekomme die folgende '>>> von tensorflow.python.client Import device_lib >>> device_lib.list_local_devices() [Name: "/ Gerät: CPU: 0" device_type: "CPU" memory_limit : 268435456 Ort { } Inkarnation: 13755107272709323438 ] 'so bedeutet dies, ich die CPU bin mit aber nicht gpu und ich bin immer noch verwirrt, warum Compiler gehen beschwert sich, dass die CPU‚nicht das binäre – kgrvamsi