PKU-Alignment / omnisafe

JMLR: OmniSafe is an infrastructural framework for accelerating SafeRL research.
https://www.omnisafe.ai
Apache License 2.0
947 stars 132 forks source link

[BUG] Nice Repo! But when use CUP algorithm's configs doesn't have lagrangian_upper_bound #45

Closed yinglinmonian closed 1 year ago

yinglinmonian commented 1 year ago

Required prerequisites

What version of OmniSafe are you using?

0.0.2

System information

0.0.2

Problem description

In this file https://github.com/PKU-MARL/omnisafe/blob/dev/omnisafe/algorithms/on_policy/cup.py#L57. The codes are,

        Lagrange.__init__(
            self,
            cost_limit=self.cfgs.lagrange_cfgs.cost_limit,
            lagrangian_multiplier_init=self.cfgs.lagrange_cfgs.lagrangian_multiplier_init,
            lambda_lr=self.cfgs.lagrange_cfgs.lambda_lr,
            lambda_optimizer=self.cfgs.lagrange_cfgs.lambda_optimizer,
            lagrangian_upper_bound=self.cfgs.lagrange_cfgs.lagrangian_upper_bound,
        )

But the CUP's configs yaml files doesn't have lagrangian_upper_bound in lagrange_cfgs.

Reproducible example code

The Python snippets:

Command lines:

Extra dependencies:

Steps to reproduce:

1. 2. 3.

Traceback

No response

Expected behavior

No response

Additional context

No response

zmsn-2077 commented 1 year ago

Sorry, we have solved the problem in PR #44 by simply removing the lagrangian_upper_bound pass in the CUP and using the default None.

image

I hope this can helps you.

yinglinmonian commented 1 year ago

Thanks.