SciSharp / Keras.NET

Keras.NET is a high-level neural networks API for C# and F#, with Python Binding and capable of running on top of TensorFlow, CNTK, or Theano.
MIT License
591 stars 124 forks source link

How to select specific GPU for Model Prediction? #225

Closed thefillture closed 1 year ago

thefillture commented 2 years ago

Hi, I have a computer with 4 GPU installed , however , I would like to select only 1 specific GPU to do model prediction using keras.NET. How can I go about doing this ? Like example , using only GPU 2 to do model prediction , while the rest of the GPU can do other stuff.

CorentinPtrl commented 2 years ago

Hello, if you want to select ur gpu u need to set the environement variable "CUDA_VISIBLE_DEVICES" at 0, 1 or -1 for your cpu (U need to set this variable before starting keras)

thefillture commented 2 years ago

Oh, Thanks for the reply. But does it hard code all my applications to be only using that GPU? Can I do it in such a way where different applications can use different GPU?

CorentinPtrl commented 2 years ago

No it will not apply for the other applications if you just set it in one app

github-actions[bot] commented 1 year ago

Stale issue message