MrMustard icon indicating copy to clipboard operation
MrMustard copied to clipboard

fix: TensorFlow dependency set to ~2.15

Open xvalcarce opened this issue 10 months ago • 2 comments

Context:

See issue https://github.com/XanaduAI/MrMustard/issues/381

Description of the Change:

Restrict TensorFlow dependency to >=2.15 and <2.16.

xvalcarce avatar Apr 10 '24 08:04 xvalcarce

Hi @xvalcarce ,

Thanks for opening this issue up! :)

Personally, I am not convinced that TF should be restricted to version < x, because in the future we will certainly want to install y > x.

The solution to your issue may be using poetry rather than pip install. In your environment, do

pip install poetry
cd MrMustard
poetry install ...

optionally replace ... with options, like we do in our .github/workflows.

TF is locked to 2.15, so poetry should install 2.15

SamFerracin avatar Apr 10 '24 14:04 SamFerracin

Hey @SamFerracin :)

I agree, this is not a long term viable solution, but a simple quick-fix! Instead the codebase should be updated to match TF 2.16, and set this new version as a minimum requirement. This mainly involves using Adam from Keras 3 (as mentioned in the issue) as well as removing the need for tensorflow-macos as explained here. I can propose these changes in a future commit, if you are interested!

About the installation method, if an installation with cloning the repo and using poetry works fine thanks to the lock, I do believe that installing MrMustard with pip install mrmustard should provide a working module.

xvalcarce avatar Apr 10 '24 15:04 xvalcarce

Fixed in #406. Thanks again @xvalcarce :)

ziofil avatar Jun 05 '24 21:06 ziofil