Tensorflow model (.pb) has device information? -


i'm running tf application inference given models. however, it's not running on gpu, on cpu although tensorflow library built cuda enabled. have insight in tf models, tensorflow model (.pb) has device information tf.device(/cpu:0) or tf.device(/gpu:0) ???

from docs (emphasis mine):

sometimes exported meta graph training environment importer doesn't have. example, model might have been trained on gpus, or in distributed environment replicas. when importing such models, it's useful able clear device settings in graph can run on locally available devices. this can achieved calling import_meta_graph clear_devices option set true.

with tf.session() sess:   new_saver = tf.train.import_meta_graph('my-save-dir/my-model-10000.meta',       clear_devices=true)   new_saver.restore(sess, 'my-save-dir/my-model-10000') 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -