ARISE-Initiative / robosuite-benchmark

Benchmarking Repository for robosuite + SAC
52 stars 15 forks source link

RuntimeError: size mismatch #18

Open SATE001 opened 2 years ago

SATE001 commented 2 years ago

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 commented 1 year ago

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")