google / dopamine

Dopamine is a research framework for fast prototyping of reinforcement learning algorithms.
https://github.com/google/dopamine
Apache License 2.0
10.42k stars 1.36k forks source link

ModuleNotFoundError: No module named 'dopamine.metrics' #196

Closed FelipeMartins96 closed 2 years ago

FelipeMartins96 commented 2 years ago

Trying to run the test after following the getting started steps for installing from source on a python3.10 environment, I just changed the atari test to continuous domains as I did not install the atari dependencies:

❯ export PYTHONPATH=$PYTHONPATH:$PWD
❯ python -m tests.dopamine.continuous_domains.run_experiment_test.py
2022-05-18 16:39:47.505926: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/fbm/Documents/msc-marl/penv/lib/python3.10/site-packages/cv2/../../lib64:
2022-05-18 16:39:47.505943: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/home/fbm/Documents/msc-marl/dopamine/tests/dopamine/continuous_domains/run_experiment_test.py", line 22, in <module>
    from dopamine.continuous_domains import run_experiment
  File "/home/fbm/Documents/msc-marl/dopamine/dopamine/continuous_domains/run_experiment.py", line 22, in <module>
    from dopamine.discrete_domains import run_experiment as base_run_experiment
  File "/home/fbm/Documents/msc-marl/dopamine/dopamine/discrete_domains/run_experiment.py", line 34, in <module>
    from dopamine.jax.agents.dqn import dqn_agent as jax_dqn_agent
  File "/home/fbm/Documents/msc-marl/dopamine/dopamine/jax/agents/dqn/dqn_agent.py", line 32, in <module>
    from dopamine.metrics import statistics_instance
ModuleNotFoundError: No module named 'dopamine.metrics'

I was on dopamine root directory

staeter commented 2 years ago

I fixed this by changing all from dopamine.metrics to from metrics in the codebase.

psc-g commented 2 years ago

this was a bug in the script that exports our code to github. i have a fix out for review and should hopefully be pushed today or early next week.

apologies for the inconvenience!

On Thu, May 19, 2022 at 9:57 AM Simon Taeter @.***> wrote:

I fixed this by changing all from dopamine.metrics to from metrics in the codebase.

— Reply to this email directly, view it on GitHub https://github.com/google/dopamine/issues/196#issuecomment-1131726036, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3CCMME22HGXNICMZA264TVKZCDHANCNFSM5WJRJ3HQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

psc-g commented 2 years ago

i just pushed the fix. would you mind trying it again?

On Fri, May 20, 2022 at 3:38 PM Pablo Samuel Castro @.***> wrote:

this was a bug in the script that exports our code to github. i have a fix out for review and should hopefully be pushed today or early next week.

apologies for the inconvenience!

On Thu, May 19, 2022 at 9:57 AM Simon Taeter @.***> wrote:

I fixed this by changing all from dopamine.metrics to from metrics in the codebase.

— Reply to this email directly, view it on GitHub https://github.com/google/dopamine/issues/196#issuecomment-1131726036, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3CCMME22HGXNICMZA264TVKZCDHANCNFSM5WJRJ3HQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

FelipeMartins96 commented 2 years ago

Thank you @psc-g, I will try again later today

FelipeMartins96 commented 2 years ago

@psc-g the dopamine.metrics error was solved! I went through the getting started section again on a fresh environment in python 3.8.13 and ran python -m tests.dopamine.continuous_domains.run_experiment_test.py (I did not want to deal with ROM downloads) and the dopamine.metrics error was not raised this time.

However, I would like to add that I had to install separately the dm-control module, as I got the following error message after the first try of running the continuous_domains test:

ModuleNotFoundError: No module named 'dm_control'