MIC-DKFZ / HD-BET

MRI brain extraction tool
Apache License 2.0
255 stars 61 forks source link

Multi-GPU #12

Closed vkyprmr closed 3 years ago

vkyprmr commented 3 years ago

Hi, firstly thanks for a great package. I wanted to know if I can somehow implement multiple gpus when available. I am not so familiar with pytorch, can you tell me if you are planning to make it a feature or can you help me with how i can integrate multiple gpus using existing scripts?

FabianIsensee commented 3 years ago

Hi Vicky, there is no easy way to do that due to how HD-BET is implemented but you can use a simple workaround (my example is for 2 GPUs): just place 50% of the image in folder1 and the other 50 in folder2, then run hd-bet twice like this:

CUDA_VISIBLE_DEVICES=0 hd-bet -i folder1 -o folder1_out &
CUDA_VISIBLE_DEVICES=1 hd-bet -i folder2 -o folder2_out
wait

This will make the two predictions in parallel Best, Fabian

vkyprmr commented 3 years ago

Thanks Fabian 😄