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

RuntimeError: size mismatch #18

Open
SATE001 opened this issue Mar 8, 2022 · 1 comment
Open

RuntimeError: size mismatch #18

SATE001 opened this issue Mar 8, 2022 · 1 comment

Comments

@SATE001
Copy link

SATE001 commented Mar 8, 2022

Hi.

I ran the "simple example" in "Visualizing Rollouts". However, I get the following error: Can anyone please tell me how to deal with it?

python scripts/rollout.py --load_dir runs/Wipe-Panda-JOINT-VELOCITY-SEED17/Wipe_Panda_JOINT_VELOCITY_SEED17_2020_09_21_23_14_02_0000--s-0 --horizon 200 --camera frontview

Traceback (most recent call last):
File "scripts/rollout.py", line 107, in
use_gpu=args.gpu,
File "/home/s/wsp/robo_bench/robosuite-benchmark/scripts/util/rlkit_utils.py", line 264, in simulate_policy
video_writer=video_writer,
File "/home/s/wsp/robo_bench/robosuite-benchmark/scripts/util/rlkit_custom.py", line 425, in rollout
a, agent_info = agent.get_action(o)
File "/home/s/wsp/robo_bench/rlkit/rlkit/torch/sac/policies.py", line 134, in get_action
deterministic=True)
File "/home/s/wsp/robo_bench/rlkit/rlkit/torch/sac/policies.py", line 63, in get_action
actions = self.get_actions(obs_np[None], deterministic=deterministic)
File "/home/s/wsp/robo_bench/rlkit/rlkit/torch/sac/policies.py", line 67, in get_actions
return eval_np(self, obs_np, deterministic=deterministic)[0]
File "/home/s/wsp/robo_bench/rlkit/rlkit/torch/core.py", line 18, in eval_np
outputs = module(*torch_args, **torch_kwargs)
File "/home/s/wsp/robo_bench/robobench_venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/s/wsp/robo_bench/rlkit/rlkit/torch/sac/policies.py", line 83, in forward
h = self.hidden_activation(fc(h))
File "/home/s/wsp/robo_bench/robobench_venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/s/wsp/robo_bench/robobench_venv/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)
File "/home/s/wsp/robo_bench/robobench_venv/lib/python3.7/site-packages/torch/nn/functional.py", line 1370, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, m1: [1 x 350], m2: [379 x 256] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:290

`

@kimyejin2000
Copy link

kimyejin2000 commented Oct 4, 2022

I found out. there is an error to the script. Please change it too
rollout.py (line95) to keys.append(f"robot{idx}_robot-state")

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