How can I run Tensorflow on one single core? -


i'm using tensorflow on cluster , want tell tensorflow run on 1 single core (even though there more available).

does know if possible?

to run tensorflow on 1 single cpu thread, use:

session_conf = tf.configproto(       intra_op_parallelism_threads=1,       inter_op_parallelism_threads=1) sess = tf.session(config=session_conf) 

device_count limits number of cpus being used, not number of cores or threads.

tensorflow/tensorflow/core/protobuf/config.proto says:

message configproto {   // map device type name (e.g., "cpu" or "gpu" ) maximum   // number of devices of type use.  if particular device   // type not found in map, system picks appropriate   // number.   map<string, int32> device_count = 1; 

on linux can run sudo dmidecode -t 4 | egrep -i "designation|intel|core|thread" see how many cpus/cores/threads have, e.g. following has 2 cpus, each of them has 8 cores, each of them has 2 threads, gives total of 2*8*2=32 threads:

fra@s:~$ sudo dmidecode -t 4 | egrep -i "designation|intel|core|thread"     socket designation: cpu1     manufacturer: intel             htt (multi-threading)     version: intel(r) xeon(r) cpu e5-2667 v4 @ 3.20ghz     core count: 8     core enabled: 8     thread count: 16             multi-core             hardware thread     socket designation: cpu2     manufacturer: intel             htt (multi-threading)     version: intel(r) xeon(r) cpu e5-2667 v4 @ 3.20ghz     core count: 8     core enabled: 8     thread count: 16             multi-core             hardware thread 

tested tensorflow 0.12.1 , 1.0.0 ubuntu 14.04.5 lts x64 , ubuntu 16.04 lts x64.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -