liupei101 / TFDeepSurv

COX Proportional risk model and survival analysis implemented by tensorflow.
MIT License
99 stars 27 forks source link

gpu support #9

Open bnuzyc91 opened 3 years ago

bnuzyc91 commented 3 years ago

@liupei101 Thank you so much for the package.

Could you please advise is it possible to use GPU support for this TFDeepSurv package?

Thank you!

liupei101 commented 3 years ago

Only FC layers are used in DeepSurv model, not involving Conv etc, but you can modify code to adapt your environment (GPU or CPU).

PRs are welcomed!

bnuzyc91 commented 3 years ago

I tried to find a way to use the GPU without modifying the code and since I notice that you have utilized the tensorflow 1.* version for TFDeepSurv. I have done the following:

1) install the TensorFlow 1.15-GPU version using pip3 install tensorflow-gpu==1.15 2) run the TFDeepSurv code under TensorFlow 1.15-GPU using my GPU[0] I notice that the percentage of GPU utilization is in the range of 0%~3% [0] TITAN RTX | 60'C, 3 % | 23216 / 24217 MB |

I am not sure if this actually uses the GPU or not. I think it uses since I can see the temperature of GPU raise and the percentage is not always 0%. But on the other hand, I am not sure why the GPU utilization is low.

Could you please advise if I did the right thing? Thank you!