Update tutorials to revise the pip installation command for TFQ 0.7.5 and also avoid a couple of problems #949
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
Update the
!pip installcommand in all the tutorials indocs/tutorials/to usepip install tensorflow==2.16.2 tensorflow-quantum==0.7.5.Add a pip install of the Python package seaborn to the the MNIST tutorial. The tutorial imports
seaborn, but does not install it. Seaborn seems to come preinstalled in Colab and the DevSite toolchain, but someone running the notebook outside of those environments may hit a "module not found" error. By running a!pip install seabornafter installing TF and TFQ, we can not only save users the annoyance; we can also save future TFQ maintainers the time to debug the problem if they encounter the missing module during local testing.Pin the version of the Gym package installed in
docs/tutorials/quantum_reinformcement_learning.ipynb. Previously, the tutorial simply did a!pip install gymwithout a version constraint. Versions higher than 0.24.1 are incompatible some code in that tutorial (at least in TFQ 0.7.5), leading to an error during execution in some environments. Version 0.24.1 is what is installed byscripts/ci_validate_tutorials.sh; that's how I found the right version to make things work.