PencilKit / Reducing-Systemic-Risk-with-DDPG

3 stars 2 forks source link

What's your Python virtual environment configuration ? #1

Open EthanLingo opened 1 month ago

EthanLingo commented 1 month ago

I tried to configure TensorFlow on Mac OS and Win11 but it ran with errors:

2024-05-21 11:36:56.169279: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-05-21 11:36:56.584641: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
WARNING:tensorflow:From D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\_utils.py:48: The name tf.logging.TaskLevelStatusMessage is deprecated. Please use tf.compat.v1.logging.TaskLevelStatusMessage instead.

WARNING:tensorflow:From D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\_utils.py:48: The name tf.control_flow_v2_enabled is deprecated. Please use tf.compat.v1.control_flow_v2_enabled instead.

Traceback (most recent call last):
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\train.py", line 11, in <module>
    from tf_agents.environments import tf_py_environment
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tf_agents\__init__.py", line 74, in <module>
    from tf_agents import agents
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tf_agents\agents\__init__.py", line 17, in <module>
    from tf_agents.agents import behavioral_cloning
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tf_agents\agents\behavioral_cloning\__init__.py", line 17, in <module>
    from tf_agents.agents.behavioral_cloning import behavioral_cloning_agent
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tf_agents\agents\behavioral_cloning\behavioral_cloning_agent.py", line 37, in <module>
    import tensorflow_probability as tfp
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\__init__.py", line 20, in <module>
    from tensorflow_probability import substrates
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\substrates\__init__.py", line 17, in <module>
    from tensorflow_probability.python.internal import all_util
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\__init__.py", line 138, in <module>
    dir(globals()[pkg_name])  # Forces loading the package from its lazy loader.
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\internal\lazy_loader.py", line 57, in __dir__
    module = self._load()
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\internal\lazy_loader.py", line 40, in _load
    module = importlib.import_module(self.__name__)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\experimental\__init__.py", line 31, in <module>
    from tensorflow_probability.python.experimental import bayesopt
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\experimental\bayesopt\__init__.py", line 17, in <module>
    from tensorflow_probability.python.experimental.bayesopt import acquisition
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\experimental\bayesopt\acquisition\__init__.py", line 19, in <module>
    from tensorflow_probability.python.experimental.bayesopt.acquisition.expected_improvement import GaussianProcessExpectedImprovement
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\experimental\bayesopt\acquisition\expected_improvement.py", line 19, in <module>
    from tensorflow_probability.python.distributions import normal
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\distributions\__init__.py", line 110, in <module>
    from tensorflow_probability.python.distributions.pixel_cnn import PixelCNN
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\distributions\pixel_cnn.py", line 33, in <module>
    from tensorflow_probability.python.layers import weight_norm
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\layers\__init__.py", line 27, in <module>
    from tensorflow_probability.python.layers.distribution_layer import CategoricalMixtureOfOneHotCategorical
  File "D:\Users\ethan\LocalFiles\CodesFile\economics\Reducing-Systemic-Risk-with-DDPG\.venv\lib\site-packages\tensorflow_probability\python\layers\distribution_layer.py", line 68, in <module>
    tf.keras.__internal__.utils.register_symbolic_tensor_type(dtc._TensorCoercible)  # pylint: disable=protected-access
AttributeError: module 'keras._tf_keras.keras' has no attribute '__internal__'

I tried several environmental configurations and nothing worked. So I want to ask you what kind of environment configuration is it?

This is my Python 3.9 virtual environment configuration:

pip list

Package                      Version
---------------------------- -----------
absl-py                      2.1.0
astunparse                   1.6.3
certifi                      2024.2.2
charset-normalizer           3.3.2
clarabel                     0.7.1
cloudpickle                  3.0.0
contourpy                    1.2.1
cvxpy                        1.5.1
cycler                       0.12.1
decorator                    5.1.1
dm-tree                      0.1.8
ecos                         2.0.13
flatbuffers                  24.3.25
fonttools                    4.51.0
gast                         0.5.4
gin-config                   0.5.0
google-pasta                 0.2.0
grpcio                       1.64.0
gym                          0.23.0
gym-notices                  0.0.8
h5py                         3.11.0
idna                         3.7
importlib_metadata           7.1.0
importlib_resources          6.4.0
keras                        3.3.3
kiwisolver                   1.4.5
libclang                     18.1.1
Markdown                     3.6
markdown-it-py               3.0.0
MarkupSafe                   2.1.5
matplotlib                   3.9.0
mdurl                        0.1.2
ml-dtypes                    0.3.2
namex                        0.0.8
networkx                     3.2.1
numpy                        1.26.4
opt-einsum                   3.3.0
optree                       0.11.0
osqp                         0.6.5
packaging                    24.0
pillow                       10.3.0
pip                          23.2.1
protobuf                     4.25.3
pygame                       2.1.3
Pygments                     2.18.0
pyparsing                    3.1.2
python-dateutil              2.9.0.post0
qdldl                        0.1.7.post2
requests                     2.32.1
rich                         13.7.1
scipy                        1.11.4
scs                          3.2.4.post1
setuptools                   68.2.0
six                          1.16.0
tensorboard                  2.16.2
tensorboard-data-server      0.7.2
tensorflow                   2.16.1
tensorflow-intel             2.16.1
tensorflow-io-gcs-filesystem 0.31.0
tensorflow-probability       0.23.0
termcolor                    2.4.0
tf-agents                    0.19.0
typing_extensions            4.5.0
urllib3                      2.2.1
Werkzeug                     3.0.3
wheel                        0.41.2
wrapt                        1.16.0
zipp                         3.18.2
PencilKit commented 1 month ago

Hi Ethan, this repo is no longer being maintained, but I've generated and pushed a requirements.txt, I hope that helps

EthanLingo commented 1 month ago

Thank you very much, I'll try it and hope it works.