20210301のTensorFlowに関する記事は1件です。

TensorFlow(Keras) 2.xでCPUで計算するときの方法

1系の場合では、

config = tf.ConfigProto(device_count = {'GPU': 0})

ですが、2系では

tf.config.set_visible_devices([], 'GPU')

と記載することでCPUモードで使用できます。

参考資料
[TF 2.0] How to globally force CPU?

  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む