## Force TF to use CPU oterwise we set the ID of the string of GPU we wanna use but here we are going use CPU
os.environ['CUDA_VISIBLE_DEVICES'] = '1' #e.g. str(FLAGS.gpu_id)# '7'
if use_gpu == False:
dev = '/cpu:0'
print("Using CPU")
elif use_gpu == True:
dev = '/gpu:0'
print("Using GPU " + os.environ['CUDA_VISIBLE_DEVICES'])
else:
raise ValueError('Only support 0 or 1 gpu.')
the code change the dev variable, but is dev be used anywhere else?
in the
esimatePose
function:the code change the
dev
variable, but isdev
be used anywhere else?