2

I'm using Keras with Tensorflow to replicate a DQN. Actually I'm using 2 GPUs, but I want to make my code executable in every machine, regardless the number of GPUs it has. So my question is: how can I get the number of GPUs present in my PC? I checked this but it gets me a lot of info I don't need. Is there any other way to get the number of GPUs?

Joaquin
  • 139
  • 1
  • 3
  • 12

1 Answers1

0

If you want to know how many GPUs are there running tf.contrib.eager.num_gpus() will give you the answer.

D_negn
  • 378
  • 4
  • 13
  • When I try to use that, it gives me the following error: File "", line 28 def single_image_random_dot_stereograms(depth_values, hidden_surface_removal=True, convergence_dots_size=8, dots_per_inch=72, eye_separation=2,5, mu=0,333299994, normalize=True, normalize_max=-100, normalize_min=100, border_level=0, number_colors=256, output_image_shape=[1024, 768, 1], output_data_window=[1022, 757], name=None): ^ SyntaxError: invalid syntax – Joaquin Apr 13 '19 at 04:20