Robotics
Safetensors
lerobot

AssertionError: `mean` is infinity. You should either initialize with `stats` as an argument, or use a pretrained model.

#8
by cloudfan - opened

(lerobot) arc@nvda:~/Downloads/lerobot-main$ python lerobot/scripts/eval.py --policy.path=lerobot/pi0 --env.type=aloha --eval.batch_size=10 --eval.n_episodes=10 --use_amp=false --device=cuda
INFO 2025-02-27 10:39:58 pts/eval.py:458 {'device': 'cuda',
'env': {'episode_length': 400,
'features': {'action': {'shape': (14,),
'type': <FeatureType.ACTION: 'ACTION'>},
'agent_pos': {'shape': (14,),
'type': <FeatureType.STATE: 'STATE'>},
'pixels/top': {'shape': (480, 640, 3),
'type': <FeatureType.VISUAL: 'VISUAL'>}},
'features_map': {'action': 'action',
'agent_pos': 'observation.state',
'pixels/top': 'observation.images.top',
'top': 'observation.image.top'},
'fps': 50,
'obs_type': 'pixels_agent_pos',
'render_mode': 'rgb_array',
'task': 'AlohaInsertion-v0'},
'eval': {'batch_size': 10, 'n_episodes': 10, 'use_async_envs': False},
'job_name': 'aloha_pi0',
'output_dir': PosixPath('outputs/eval/2025-02-27/10-39-58_aloha_pi0'),
'policy': {'adapt_to_pi_aloha': False,
'attention_implementation': 'eager',
'chunk_size': 50,
'empty_cameras': 0,
'freeze_vision_encoder': True,
'input_features': {},
'max_action_dim': 32,
'max_state_dim': 32,
'n_action_steps': 50,
'n_obs_steps': 1,
'normalization_mapping': {'ACTION': <NormalizationMode.MEAN_STD: 'MEAN_STD'>,
'STATE': <NormalizationMode.MEAN_STD: 'MEAN_STD'>,
'VISUAL': <NormalizationMode.IDENTITY: 'IDENTITY'>},
'num_steps': 10,
'optimizer_betas': (0.9, 0.95),
'optimizer_eps': 1e-08,
'optimizer_lr': 2.5e-05,
'optimizer_weight_decay': 1e-10,
'output_features': {},
'proj_width': 1024,
'resize_imgs_with_padding': (224, 224),
'scheduler_decay_lr': 2.5e-06,
'scheduler_decay_steps': 30000,
'scheduler_warmup_steps': 1000,
'tokenizer_max_length': 48,
'train_expert_only': False,
'train_state_proj': True,
'use_cache': True,
'use_delta_joint_actions_aloha': False},
'seed': 1000,
'use_amp': False}
INFO 2025-02-27 10:39:58 pts/eval.py:467 Output dir: outputs/eval/2025-02-27/10-39-58_aloha_pi0
INFO 2025-02-27 10:39:58 pts/eval.py:469 Making environment.
INFO 2025-02-27 10:39:58 /init.py:88 MUJOCO_GL is not set, so an OpenGL backend will be chosen automatically.
INFO 2025-02-27 10:39:58 /init.py:96 Successfully imported OpenGL backend: %s
INFO 2025-02-27 10:39:58 /init.py:31 MuJoCo library version is: %s
INFO 2025-02-27 10:39:59 pts/eval.py:472 Making policy.
Stepping through eval batches: 0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):teps: 0%| | 0/400 [00:00<?, ?it/s]
File "/home/arc/Downloads/lerobot-main/lerobot/scripts/eval.py", line 502, in
eval()
File "/home/arc/Downloads/lerobot-main/lerobot/configs/parser.py", line 120, in wrapper_inner
response = fn(cfg, *args, **kwargs)
File "/home/arc/Downloads/lerobot-main/lerobot/scripts/eval.py", line 481, in eval
info = eval_policy(
File "/home/arc/Downloads/lerobot-main/lerobot/scripts/eval.py", line 294, in eval_policy
rollout_data = rollout(
File "/home/arc/Downloads/lerobot-main/lerobot/scripts/eval.py", line 159, in rollout
action = policy.select_action(observation)
File "/home/arc/anaconda3/envs/lerobot/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "/home/arc/Downloads/lerobot-main/lerobot/common/policies/pi0/modeling_pi0.py", line 276, in select_action
batch = self.normalize_inputs(batch)
File "/home/arc/anaconda3/envs/lerobot/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/arc/anaconda3/envs/lerobot/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
File "/home/arc/anaconda3/envs/lerobot/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "/home/arc/Downloads/lerobot-main/lerobot/common/policies/normalize.py", line 169, in forward
assert not torch.isinf(mean).any(), _no_stats_error_str("mean")
AssertionError: mean is infinity. You should either initialize with stats as an argument, or use a pretrained model.

I am not quite familiar with lerobot,could someone tell me how to solve this problem.

I'm having the same problem, can anyone help with this?

I'm having the same problem

Sign up or log in to comment