It is used to choose gpu to run for AI.
- Download it, and then run
python setup.py build
python setup.py install
- Use pip by running code
pip install git+https://github.com/DogfishBone/GpuManager.git
- Import the package
from gpu_control import GpuManager
- Create an entry by
my_gpu = GpuManager(visible_gpus)
- Then run
res = my_gpu.set_by_memory(top_k)
to choose your gpus
For example, with a Keras or Tensorflow framework.
- Import the package
from gpu_control.framework_setting import set_tensorflow_config
- Then in your codes, you can write
config = set_tensorflow_config(fraction, is_auto_increase)
to set the fraction and auto_increase for the framework.