-2

I am following this tutorial. I have two nvidia 1080 Ti graphic card but I can't the code.

enter image description here

I have error in line 8 I also have a laptop with one GPU where this code works fine

I changed the code a little bit.

tf.config.experimental.set_memory_growth(physical_devices[0:1], True)

but still same error

talonmies
  • 70,661
  • 34
  • 192
  • 269
Ammar0000
  • 23
  • 5

1 Answers1

1

Thanks community I figure out the answer.

Instead of using:

tf.config.experimental.set_memory_growth(physical_devices[0:1], True)

I have to used:

tf.config.experimental.set_memory_growth(physical_devices[0], True)
tf.config.experimental.set_memory_growth(physical_devices[1], True)

and with this modification my code works well on both my GPU without raise any error.

frankfalse
  • 1,553
  • 1
  • 4
  • 17
Ammar0000
  • 23
  • 5