question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action values become a negative float value after 100 total timestep

See original GitHub issue

🐛 Bug

Action values become a negative float value after 100 total timestep

To Reproduce

My env file

class NQEnv(gym.Env):
    metadata = {'render.modes': ['console']}
    def __init__(self):
        self.action_space = spaces.Discrete(6)
        self.observation_space = spaces.Box(low=0, high=255, shape=(70, 70, 1), dtype=np.uint8)
...
actions = ['left_arrow', 'right_arrow', 'up_arrow', 'down_arrow', 'spacebar', 'nothing']
        try:
            print("action: " + str(actions[action]) + "  which stage: " + str(self._stage))
...

main.py

from stable_baselines3 import SAC
from stable_baselines3.common.cmd_util import DummyVecEnv
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.sac.policies import CnnPolicy
..

env = DummyVecEnv([lambda: NQEnv()])
model = SAC(CnnPolicy, env, verbose=2).learn(total_timesteps=5000, log_interval=1)

I run main.py and it works fine until the total timesteps hit 100 (3 minutes?). Action values become a negative float value afterwards as shown on the following screenshots. Screenshot 2020-12-04 at 23 58 23

Screenshot 2020-12-04 at 23 41 34

Expected behavior

Action values continue to be integer

### System Info

Describe the characteristic of your environment: -macos big sur -python 3.8.6 -tf-nightly: 2.5.0.dev20201204 -numpy : 1.19.4 -stable-baselines3: 0.10.0 -gym 0.17.3

pip check doesn’t show any broken dependencies.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
Miffylicommented, Dec 5, 2020

Thanks for the kind words! These help us stay motivated to contribute projects like this 😃

Lets keep this issue open until @araffin comments on my comment above about possible enhancement.

1reaction
cosmir17commented, Dec 5, 2020

@Miffyli, I am super excited to use this library!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is negative float (negative slack) in project management?
Negative float (negative slack) is a common concept in project management. It refers to the amount of time that must be saved to...
Read more >
How to deal with floating point number precision in JavaScript?
Does anyone have a good solution so that in such case I get the correct result 0.02 ? I know there are functions...
Read more >
Earned Value and Negative Float - Humphreys & Associates
When the task Total Float value is zero, the task cannot slip at all. Conditions 1 and 2 should be the norm, with...
Read more >
SensorEvent - Android Developers
In this system, coordinates behind the screen have negative Z values. ... in order to get a delta rotation from this sample over...
Read more >
Advantage Actor Critic Tutorial: minA2C - Towards Data Science
The actor network chooses an action at each time step and the critic network evaluates the quality or the Q-value of a given...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found