-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot seem to install TF versions less then 2.16. #602
Comments
Hi, thanks for opening the issue. Two notes: tensorflow::install_tensorflow(
version = "release" # or "2.16" or "2.17"
envname = "r-tensorflow",
extra_packages = "tf_keras", # legacy keras
python_version = "3.10"
) # New R session
Sys.setenv("TF_USE_LEGACY_KERAS"="1")
tensorflow::tf_config() # initialize python, load tensorflow+keras
keras:::keras_version() < "3.0" # confirm legacy Keras in use Second, the error you're seeing about Note, you can also supply to If you need to install a version, I recommend using reticulate::install_python("3.10") If you're frequently installing on linux, you might also be interested to know there are pre-built python binaries available here: https://github.com/rstudio/python-builds. |
Hi @t-kalinowski ! Thank you so much for your help here, I really appreciate it! I had no idea that
That sounds really useful, currently the process in greta is to use reticulate::conda_create(
envname = "greta-env-tf2",
python_version = python_version
) Where python version is specified as a deps object (greta-dev/greta#674) So if we did: reticulate::conda_create(
envname = "greta-env-tf2",
python_version = ">=3.9,<=3.11"
) Do you know what the process is for choosing the python version? At the moment I think we are going to implement a (somewhat complex, but hopefully understandable) checking system based on the compatible versions of TF/TFP/Python where we know a valid set of each. This should hopefully then error before the installation begins, so then the user can be stopped earlier. I did not know that we could use later Keras, that is really useful. I will open an issue on greta to keep track of how to manage that. |
Just to clarify on
If you're updating greta's Python environment setup, take a look at the updated guidelines on managing Python dependencies in reticulate here. It might also be worth considering switching from Conda to virtual environments to avoid compatibility issues. Virtual environments are usually simpler and avoid binary compatibility problems that can cause segfaults. You might find the functions |
We require to use TF version < 2.16.0 and below, since they use keras 3, which causes breaking changes.
However when trying to install TF versions below 2.16, I cannot, I get this message:
Which makes it sound like there's some issue with which version of TF is being grabbed?
Created on 2024-08-05 with reprex v2.1.1
Session info
Some extra text appears when running this locally not via reprex, which is:
Is it possible that there is a new set of default installation versions? I get a similar message with 2.13:
Created on 2024-08-05 with reprex v2.1.1
Session info
And
Trying out
reticulate::py_install()
yielded similar resultsCreated on 2024-08-05 with reprex v2.1.1
Session info
The text was updated successfully, but these errors were encountered: