Slicer crashes after installing and importing tensorflow on linux

Operating system: Fedora Linux 39
Slicer version: Slicer-5.6.1
Expected behavior: Import tensorflow from a python extension
Actual behavior: Slicer crashes after installing tensorflow

After installing Slicer-5.6.1 on linux, I have created a new extension TestExtension using the Extension Wizard module in which I have added a new module TestModule. Then, I have installed the latest version of tensorflow (2.15.0.post1) using the synthax pip_install(‘tensorflow’) in the python console. When I restart Slicer, everything works fine. Then I added on the python file TestExtension/ the line “import tensorflow as tf”. After doing that I cannot restart Slicer as it crashes everytime with the following code:

The medical image computing research community seems to have moved away from TensorFlow/Keras and standardized on using pytorch. Pytorch has become critically important for Slicer community as well, many users on many types of computers, GPUs, operating systems test it and we quickly fix any problems that arise.

In contrast, there might be a few extensions that use tensorflow for historical reasons, but they are not widely used and I’m not sure how well supported. Probably they all run tensorflow in an external Python environment. Of course this is really inconvenient for end users, as users don’t want to install Python and set up virtual python environments.

Overall, if you work in the medical image computing field then you might consider switching to using pytorch, as you will be part of a larger community and it will probably make your life easier.

The below Google search interest metrics seems to support the idea that PyTorch has become more preferred than Tensorflow since 2021.,tensorflow&hl=en