MarkFzp / act-plus-plus

Imitation learning algorithms with Co-training for Mobile ALOHA: ACT, Diffusion Policy, VINN
https://mobile-aloha.github.io/
MIT License
2.86k stars 525 forks source link

[fix] ValueError: low >= high #49

Open destroy314 opened 2 months ago

destroy314 commented 2 months ago

If you met this:

  ...
  File ".../.conda/envs/aloha/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 623, in _next_index
    return next(self._sampler_iter)  # may raise StopIteration
  File ".../act-plus-plus-main/utils.py", line 216, in BatchSampler
    step_idx = np.random.randint(sum_dataset_len_l[episode_idx], sum_dataset_len_l[episode_idx + 1])
  File "mtrand.pyx", line 765, in numpy.random.mtrand.RandomState.randint
  File "_bounded_integers.pyx", line 1247, in numpy.random._bounded_integers._rand_int64
ValueError: low >= high

comment the data that not in public datasets:

# cabinet
'aloha_mobile_cabinet':{
    'dataset_dir': [
        DATA_DIR + '/aloha_mobile_cabinet',
        # DATA_DIR + '/aloha_mobile_cabinet_handles', # 200    <--
        # DATA_DIR + '/aloha_mobile_cabinet_grasp_pots', # 200    <--
    ], # only the first dataset_dir is used for val
    'stats_dir': [
        DATA_DIR + '/aloha_mobile_cabinet',
    ],
    # 'sample_weights': [6, 1, 1],    <--
    'train_ratio': 0.99, # ratio of train data from the first dataset_dir
    'episode_len': 1500,
    'camera_names': ['cam_high', 'cam_left_wrist', 'cam_right_wrist']
},