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

Gradient issue #5

Open
GoingMyWay opened this issue Apr 21, 2020 · 0 comments
Open

Gradient issue #5

GoingMyWay opened this issue Apr 21, 2020 · 0 comments

Comments

@GoingMyWay
Copy link

When setting

"actor_feature_reg": None,

and run the simple env, it will report

ValueError: No gradients provided for any variable: ["<tf.Variable 'policy_0/actor/policy_0/actor_feature/dense/kernel:0' shape=(4, 64) dtype=float32_ref>", "<tf.Variable 'policy_0/actor/policy_0/actor_feature/dense/bias:0' shape=(64,) dtype=float32_ref>", "<tf.Variable 'policy_0/actor/policy_0/actor_feature/dense_1/kernel:0' shape=(64, 64) dtype=float32_ref>", "<tf.Variable 'policy_0/actor/policy_0/actor_feature/dense_1/bias:0' shape=(64,) dtype=float32_ref>", "<tf.Variable 'policy_0/actor/dense/kernel:0' shape=(64, 5) dtype=float32_ref>", "<tf.Variable 'policy_0/actor/dense/bias:0' shape=(5,) dtype=float32_ref>"].

So, I think it quite confusing.

        act_n = act_ph_n.copy()
        act_n[agent_id] = act_sampler
        critic, _, _, _ = self._build_critic_network(
            obs_ph_n,
            act_n,
            obs_space_n,
            act_space_n,
            config["use_state_preprocessor"],
            config["critic_hiddens"],
            getattr(tf.nn, config["critic_hidden_activation"]),
            scope="critic")

Since act_sampler is set and the gradient will be computed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant