Exit code 409 when trying to run through tensorflow example in pycharm

I am trying to go through the DCGAN example on the tensorflow website https://www.tensorflow.org/tutorials/generative/dcgan. it seems to run fine up until the step where it uses the generator
generated_image = generator(noise, training=False). At that point it exits with error code
Process finished with exit code -1073740791 (0xC0000409).

I am running on Windows 10 using pycharm. I have tried messing with the batch size in case this is a memory issue, but even setting it to 1 gives the same results. I have also tried running pycharm as administrator.

Hi @ivan_viti

Welcome to the TensorFlow Forum!

It seems, there is either installed TensorFlow version or supporting Hardware issue which is causing the above error. Please ensure it detects GPU if you have setup GPU with tensorflow. You can refer to this TF install official page to install TensorFlow in your system and install all the required softwares as mentioned in the link.

This code is running fine when I tried replicating the above code in Google Colab using Python 3.10 and Tensorflow 2.14. Please try reinstalling the latest Tensorflow version (2.10 in winOS for GPU support) by following the step by step instructions mentioned in the mentioned link and let us know if the issue still persists. Thank you.