Skip to content
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

TD3 does not work ('ExaGlobal' is not defined) #246

Open
aik7 opened this issue Dec 29, 2022 · 1 comment
Open

TD3 does not work ('ExaGlobal' is not defined) #246

aik7 opened this issue Dec 29, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@aik7
Copy link
Collaborator

aik7 commented Dec 29, 2022

In the ddpg_debug branch, I ran the following command.

python exarl/driver/ --env Pendulum-v0 --n_episodes 50 --n_steps 200 --learner_procs 1 --workflow sync --agent TD3-v1 --model_type AC  

However, I got the following error. The TD3 code need to be updated.

Traceback (most recent call last):
  File "/home/kagawa/anaconda3/envs/exarl/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kagawa/anaconda3/envs/exarl/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "exarl/driver/__main__.py", line 29, in <module>
    exa_learner = exarl.ExaLearner()
  File "/home/kagawa/Projects/EXARL/exarl/base/learner_base.py", line 46, in __init__
    self.agent, self.env, self.workflow = self.make(agent_id, env_id, workflow_id)
  File "/home/kagawa/Projects/EXARL/exarl/base/learner_base.py", line 95, in make
    agent = exarl.agents.make(agent_id, env=env, is_learner=ExaComm.is_learner())
  File "/home/kagawa/Projects/EXARL/exarl/agents/registration.py", line 98, in make
    return registry.make(id, **kwargs)
  File "/home/kagawa/Projects/EXARL/exarl/agents/registration.py", line 58, in make
    agent = spec.make(**kwargs)
  File "/home/kagawa/Projects/EXARL/exarl/agents/registration.py", line 42, in make
    cls = load(self.entry_point)
  File "/home/kagawa/Projects/EXARL/exarl/agents/registration.py", line 20, in load
    mod = importlib.import_module(mod_name)
  File "/home/kagawa/anaconda3/envs/exarl/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/kagawa/Projects/EXARL/exarl/agents/agent_vault/__init__.py", line 16, in <module>
    from exarl.agents.agent_vault.keras_td3 import KerasTD3
  File "/home/kagawa/Projects/EXARL/exarl/agents/agent_vault/keras_td3.py", line 36, in <module>
    logger = ExaGlobal.setup_logger(__name__)
NameError: name  'ExaGlobal' is not defined
@aik7 aik7 added the bug Something isn't working label Dec 29, 2022
@aik7
Copy link
Collaborator Author

aik7 commented Jan 9, 2023

I fixed the above error by replacing ExaGlobal by ExaGlobals, but I got another error as shown below. @Jodasue, how should I fix this error?

Traceback (most recent call last):                                                                                                                                                                            
  File "/home/kagawa/anaconda3/envs/exarl/lib/python3.7/runpy.py", line 193, in _run_module_as_main                                                                                                           
    "__main__", mod_spec)                                                                                                                                                                                     
  File "/home/kagawa/anaconda3/envs/exarl/lib/python3.7/runpy.py", line 85, in _run_code                                                                                                                      
    exec(code, run_globals)                                                                                                                                                                                   
  File "exarl/driver/__main__.py", line 29, in <module>                                                                                                                                                       
    exa_learner = exarl.ExaLearner()                                                                                                                                                                          
  File "/home/kagawa/Projects/EXARL/exarl/base/learner_base.py", line 46, in __init__                                                                                                                         
    self.agent, self.env, self.workflow = self.make(agent_id, env_id, workflow_id)                                                                                                                            
  File "/home/kagawa/Projects/EXARL/exarl/base/learner_base.py", line 95, in make                                                                                                                             
    agent = exarl.agents.make(agent_id, env=env, is_learner=ExaComm.is_learner())                                                                                                                             
  File "/home/kagawa/Projects/EXARL/exarl/agents/registration.py", line 98, in make                                                                                                                           
    return registry.make(id, **kwargs)                                                                                                                                                                        
  File "/home/kagawa/Projects/EXARL/exarl/agents/registration.py", line 58, in make                                                                                                                           
    agent = spec.make(**kwargs)                                                                                                                                                                               
  File "/home/kagawa/Projects/EXARL/exarl/agents/registration.py", line 43, in make                                                                                                                           
    agent = cls(**_kwargs)                                                                                                                                                                                    
TypeError: Can't instantiate abstract class KerasTD3 with abstract methods set_priorities                                                                                                                     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant