Open maryamastero opened 2 years ago
Hi @maryamkiashemshaki it sounds like you've got Sonnet 1.0 installed alongside TensorFlow 2.X.
If you want to use TensorFlow 2, then you need to use Sonnet 2.0 (released in March 2020). You can find installation instructions here: https://github.com/deepmind/sonnet#installation
If you need to use Sonnet 1.X (for example to work with some legacy code) then please install TensorFlow 1. If you are using pip I think you can use: pip install "tensorflow<2"
.
I cannot install Sonnet 2.0 or Tensorflow<2 on my mac M1.
I cannot have a working pair of TensorFlow and sonnet on my mac. However, I could install them on colab by:
pip install "tensorflow-gpu<2" "dm-sonnet<2" "tensorflow-probability==0.7.0"
I'm afraid I don't have an M1 to test on, I'm glad you got things working in Colab and I hope that unblocks you.
Sonnet 1 is in maintenance mode only at this point (there have been no changes in v1 for 2 years), we recommend all users migrate to TensorFlow 2 and Sonnet 2 (or to JAX + Haiku if you prefer).
I would expect Sonnet 2 to "just work" on M1 (if you pip install --upgrade "dm-sonnet>=2"
) since it is a pure Python library with no native code.
I cannot install Sonnet 2.0 or Tensorflow<2 on my mac M1.
I cannot have a working pair of TensorFlow and sonnet on my mac. However, I could install them on colab by:
pip install "tensorflow-gpu<2" "dm-sonnet<2" "tensorflow-probability==0.7.0"
Trying this pip install on Colab no longer works (at least for me):
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu<2 (from versions: 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0, 2.12.0)
ERROR: No matching distribution found for tensorflow-gpu<2
Hi @drscotthawley , I replied on your other thread which should help unblock you with Sonnet 2.
I install dm-sonnet and I see: Requirement already satisfied: sonnet in
Note: you may need to restart the kernel to use updated packages.
after reseting kernel and running:
I got:
AttributeError: module 'tensorflow' has no attribute 'GraphKeys'
I work on mac M1