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

Division by zero when resetting the environment #40

Closed
manjavacas opened this issue May 27, 2021 · 0 comments
Closed

Division by zero when resetting the environment #40

manjavacas opened this issue May 27, 2021 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@manjavacas
Copy link
Member

The following non-handled exception occurs when resetting the environment:

Traceback (most recent call last):
  File "./A2C.py", line 85, in <module>
    obs = env.reset()
  File "/usr/local/lib/python3.6/dist-packages/gym/core.py", line 264, in reset
    observation = self.env.reset(**kwargs)
  File "/workspaces/energym/energym/envs/eplus_env.py", line 225, in reset
    self.logger.log_episode(episode=self.simulator._epi_num)
  File "/workspaces/energym/energym/utils/common.py", line 307, in log_episode
    self.comfort_violation_timesteps/self.total_timesteps*100)
ZeroDivisionError: division by zero

I'm using Energym v0.3.0 in Ubuntu. The error occurs in both discrete and continuous environments.

I was able to stop it from occurring by previously activating the logger with: env.env_method('activate_logger'), but this is an exception that should be handled.

Cheers!

@manjavacas manjavacas added the bug Something isn't working label May 27, 2021
@manjavacas manjavacas added this to the V 1.0 milestone May 27, 2021
@AlejandroCN7 AlejandroCN7 mentioned this issue Jun 9, 2021
@jajimer jajimer closed this as completed in 13debf6 Jun 9, 2021
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

2 participants