TensorFlow 2 support?

Hi to everyone,

I was looking for TensorFlow 2, but I was only able to import TensorFlow 1, I downloaded it as local user but It still import the older version.
In case this is already possible, I kindly ask for your help to make it work.

In case this is not supported, I suggest the introduction of something similar to this approach of Colab in which they have a magic command to tell the notebook to use TensorFlow 2.

Thanks in advance and have a nice day

I managed to install tensorFlow 2 just for me as user, this might be helpful to someone else.
I used the following commands:

!python3 -m pip install --user tensorflow==2.1
import os
os.chdir("/eos/user/m/mpalteng/.local/lib/python3.7/site-packages") # change mpalteng with your username
import tensorflow as tf

If there is a better solution please share it. Thanks

Hi Matteo,

Thank you for sharing your solution. The solution we recommend is explained in the help of SWAN here:

which relies on a user environment script to set the PYTHONPATH (so that you don’t have to change the working directory to your site-packages in every notebook).

As for your long-term proposal, thank you for pointing us to that feature. However, given how SWAN sessions work (you pick an LCG software stack with a given version of a set of packages), it is more likely that, in the future, you will choose the version of tensorflow you want to work with by using an older stack or a newer stack. For the moment, I am not aware of any plans to update tensorflow to 2.0 in the LCG releases, but as soon as that happens we will have it available in SWAN right away (first in the bleeding edge software stack).

@etejedor, we are preparing a new stack with tensorflow 2.1 that could appear in bleeding edge in the next few days if the experiments give the green light to upgrade the version of tensorflow, which is not API compatible. To be discussed at the LIM meeting today.

Ok thanks for the update @mato !