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

handle_batch_input error #4

Open
Zhong-eng opened this issue Jul 27, 2022 · 1 comment
Open

handle_batch_input error #4

Zhong-eng opened this issue Jul 27, 2022 · 1 comment

Comments

@Zhong-eng
Copy link

Hi there,

Thank you for your amazing work. I'm trying your code on Hopper env. However, I get an error from the handle_batch_input function:

Traceback (most recent call last):
  File "xxxx, line 62, in <module>
    action = ctrl.command(obs)
  File "xxx/pytorch_mppi/pytorch_mppi/mppi.py", line 194, in command
    cost_total = self._compute_total_cost_batch()
  File "xxx/pytorch_mppi/pytorch_mppi/mppi.py", line 280, in _compute_total_cost_batch
    self.cost_total, self.states, self.actions = self._compute_rollout_costs(self.perturbed_action)
  File "xxx/pytorch_mppi/pytorch_mppi/mppi.py", line 238, in _compute_rollout_costs
    c = self._running_cost(state, u)
  File "xxx/pytorch_mppi/pytorch_mppi/mppi.py", line 47, in wrapper
    ret = ret.view(*batch_dims)
ValueError: Type must be a sub-type of ndarray type

I'm wondering what this function is used for and whether you know where this error comes from.

Thank you so much for your help!

@LemonPi
Copy link
Member

LemonPi commented Jul 27, 2022

Hi, what is the input obs that you're feeding into ctrl.command? It should be a torch.tensor or convertible type (such as list, or numpy ndarray) of size nx or K x nx, where nx is the state dimension, and K is some batch dimension.

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

2 participants