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

The deque buffer has a small bug #586

Closed
youhu868 opened this issue Feb 19, 2023 · 2 comments
Closed

The deque buffer has a small bug #586

youhu868 opened this issue Feb 19, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@youhu868
Copy link

youhu868 commented Feb 19, 2023

it throw a TypeError when i change
replay_buffer=dict(replay_buffer_size=20000, ),
to
replay_buffer=dict( replay_buffer_size=20000, priority=True, priority_IS_weight=True, )
for adding priority

Traceback (most recent call last):
  File "/home/xxx/PycharmProjects/DI-engine/dizoo/classic_control/cartpole/config/cartpole_dqn_config.py", line 65, in <module>
    serial_pipeline((main_config, create_config), seed=0)
  File "/home/xxx/PycharmProjects/DI-engine/ding/entry/serial_entry.py", line 78, in serial_pipeline
    replay_buffer = create_buffer(cfg.policy.other.replay_buffer, tb_logger=tb_logger, exp_name=cfg.exp_name)
  File "/home/xxx/PycharmProjects/DI-engine/ding/worker/replay_buffer/base_buffer.py", line 136, in create_buffer
    return BUFFER_REGISTRY.build(cfg.type, cfg, *args, **kwargs)
  File "/home/xxx/PycharmProjects/DI-engine/ding/utils/registry.py", line 96, in build
    raise e
  File "/home/xxx/PycharmProjects/DI-engine/ding/utils/registry.py", line 82, in build
    return build_fn(*obj_args, **obj_kwargs)
  File "/home/xxx/PycharmProjects/DI-engine/ding/data/buffer/deque_buffer_wrapper.py", line 54, in __init__
    PriorityExperienceReplay(
TypeError: PriorityExperienceReplay.__init__() got multiple values for argument 'IS_weight'
        # priority middleware
        if self.cfg.priority:
            self.buffer.use(
                PriorityExperienceReplay(
                    self.buffer,
                    self.cfg.replay_buffer_size,
                    IS_weight=self.cfg.priority_IS_weight,
                    priority_power_factor=self.cfg.priority_power_factor,
                    IS_weight_power_factor=self.cfg.IS_weight_power_factor,
                    IS_weight_anneal_train_iter=self.cfg.IS_weight_anneal_train_iter
                )
            )

it should delete self.cfg.replay_buffer_size, code.

@PaParaZz1 PaParaZz1 added the bug Something isn't working label Feb 19, 2023
@PaParaZz1 PaParaZz1 self-assigned this Feb 19, 2023
@PaParaZz1
Copy link
Member

Thanks for your feedback, we have fixed this bug in above mentioned commit.

@youhu868
Copy link
Author

You're welcome, let's work together to maintain this project

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