NeuromatchAcademy/course-content-dl

W3D2_Tutorial1: error in setting up the environment

woodwm opened this issue · 1 comments

When running import tensorflow.compat.v2 as tf, an error shows

AttributeError: module 'tensorflow.python.training.experimental.mixed_precision' has no attribute '_register_wrapper_optimizer_cls'

See also: https://deeplearning.neuromatch.io/tutorials/W3D2_BasicReinforcementLearning/student/W3D2_Tutorial1.html#install-requirements

The problem is the incomparable karas installed by !pip install keras-nightly==2.5.0.dev2021020510 --quiet and this line should be deleted.

Another problem is !pip install dm-acme[tf] --quiet, it seems jax is also required when from acme import wrappers. So this should be !pip install dm-acme[jax,tensorflow] --quiet.

import tensorflow.compat.v2 as tf and tf.enable_v2_behavior() is unnecessary for the current tensorflow 2.

Thank you @woodwm . This issue is resolved in #540. Changes will be reflected in the book in approx. 2.5 hours. The updated code is now merged in main branch