# Can fortran be used for Training GANs in ML?

**URL:** <https://fortran-lang.discourse.group/t/can-fortran-be-used-for-training-gans-in-ml/4059>\
**Category:** Help\
**Created:** [July 24, 2022, 2:23pm UTC](https://fortran-lang.discourse.group/t/can-fortran-be-used-for-training-gans-in-ml/4059 "2022-07-24T14:23:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henilp105](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@henilp105](https://fortran-lang.discourse.group/u/henilp105)\
**Post date:** [July 24, 2022, 2:23pm UTC](https://fortran-lang.discourse.group/t/can-fortran-be-used-for-training-gans-in-ml/4059/1 "2022-07-24T14:23:22Z")

</div>

can fortran be used to train Generative adversarial networks like StyleGANs on gpu ? Is it easier to train on GPUs with fortran rather than python ? I have a dataset of 20Gb of non labelled facial data and Nvidia Tesla V100.

Thanks and Regards,  
Henil Shalin Panchal

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [July 24, 2022, 3:42pm UTC](https://fortran-lang.discourse.group/t/can-fortran-be-used-for-training-gans-in-ml/4059/2 "2022-07-24T15:42:53Z")

</div>

I don’t think so. The official NVIDIA Labs code uses Python/Tensorflow with GPUs for training: [GitHub - NVlabs/stylegan: StyleGAN - Official TensorFlow Implementation](https://github.com/NVlabs/stylegan)

Fortran machine learning frameworks are scarce and GPU programming in Fortran receives far less support compared to C/C++/Julia/Python. I’m sure you could access the [cuDNN](https://docs.nvidia.com/deeplearning/cudnn/developer-guide/index.html) or the [Intel® oneDNN](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onednn.html#gs.6q9zqr) library directly from Fortran using C bindings, but it would likely involve a lot of effort. AFAIK, the Python frameworks are calling the same optimized vendor libraries. You just need to make sure you’ve get them installed correctly with GPU support enabled.
