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

IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1) #352

Open
guest-oo opened this issue Apr 25, 2024 · 0 comments

Comments

@guest-oo
Copy link

\demo_A2C_PPO.py
env_args = {'env_name': 'CartPole-v1',
'num_envs': 1,
'max_step': 500,
'state_dim': 4,
'action_dim': 2,
'if_discrete': True}
| Arguments Remove cwd: ./CartPole-v1_DiscreteA2C_0
| Evaluator:
| step: Number of samples, or total training steps, or running times of env.step().
| time: Time spent from the start of training to this moment.
| avgR: Average value of cumulative rewards, which is the sum of rewards in an episode.
| stdR: Standard dev of cumulative rewards, which is the sum of rewards in an episode.
| avgS: Average of steps in an episode.
| objC: Objective of Critic network. Or call it loss function of critic network.
| objA: Objective of Actor network. It is the average Q value of the critic network.
################################################################################
ID Step Time | avgR stdR avgS stdS | expR objC objA etc.
Traceback (most recent call last):

tensor_action = tensor_action.argmax(dim=1)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

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