AnjanaSenanayake / DeepSelectNet

DeepSelecNet is an enhanced deep learning model to perform read classification for selective sequencing.
MIT License
14 stars 0 forks source link

Running with GPU #1

Open daanishmahajan opened 1 month ago

daanishmahajan commented 1 month ago

Hi @AnjanaSenanayake, is there an option to run the training and inference steps using GPU support?

Thanks

AnjanaSenanayake commented 1 month ago

Hi @daanishmahajan,

DeepSelectNet is built on top of TensorFlow and it can automatically detect and utilize available GPUs if you have installed the GPU version of TensorFlow (tensorflow-gpu). However, if you have multiple GPUs and want to run TensorFlow on a specific GPU, or if you want to control which GPU(s) TensorFlow uses, you need to configure it manually.

  1. Automatic GPU Detection

When you run TensorFlow code, it will automatically detect and use the available GPUs. If TensorFlow does not detect a GPU, it will fall back to using the CPU.

  1. Specify a GPU Manually

To run TensorFlow on a specific GPU, you can set the environment variable CUDA_VISIBLE_DEVICES before running your script. This environment variable controls which GPU devices are visible to your TensorFlow application.

Example: To use a Specific GPU (e.g., GPU 0)

export CUDA_VISIBLE_DEVICES=0  # Select GPU 0
python trainer.py <>