ARISE-Initiative / robomimic

robomimic: A Modular Framework for Robot Learning from Demonstration
MIT License
595 stars 182 forks source link

Help with the installation error and how to collect a own dataset without RoboTurk #5

Closed Marcelbgit closed 2 years ago

Marcelbgit commented 2 years ago

Dear developer team,

thanks again for sharing your very interesting framework. Basically, I'm trying to use your framework to build my own use case and learn a task using one of the seven algorithms (this includes a Kuka iiwa with its own gripper, objects and environments, which should be relatively quick with Robosuite and the associated XML files). However, when testing the installation in the last step, I get the following error (although I had actually fixed this in the last python script "python examples/simple_train_loop.py" by adding "export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so". Can you please help me with this?

`(robomimic_venv) @kukaiiwa:~/robomimic$ python examples/train_bc_rnn.py

============= New Training Run with Config ============= { "algo_name": "bc", "experiment": { "name": "bc_rnn_example", "validate": true, "logging": { "terminal_output_to_txt": false, "log_tb": true }, "save": { "enabled": true, "every_n_seconds": null, "every_n_epochs": 50, "epochs": [], "on_best_validation": false, "on_best_rollout_return": false, "on_best_rollout_success_rate": true }, "epoch_every_n_steps": 100, "validation_epoch_every_n_steps": 10, "env": null, "additional_envs": null, "render": false, "render_video": true, "keep_all_videos": false, "video_skip": 5, "rollout": { "enabled": true, "n": 50, "horizon": 400, "rate": 50, "warmstart": 0, "terminate_on_success": true } }, "train": { "data": "/home/obomimic/robomimic/../tests/assets/test.hdf5", "output_dir": "/home/robomimic/robomimic/../tests/tmp_model_dir", "num_data_workers": 0, "hdf5_cache_mode": "all", "hdf5_use_swmr": true, "hdf5_normalize_obs": false, "hdf5_filter_key": null, "seq_length": 10, "dataset_keys": [ "actions", "rewards", "dones" ], "goal_mode": null, "cuda": true, "batch_size": 100, "num_epochs": 2000, "seed": 1 }, "algo": { "optim_params": { "policy": { "learning_rate": { "initial": 0.0001, "decay_factor": 0.1, "epoch_schedule": [] }, "regularization": { "L2": 0.0 } } }, "loss": { "l2_weight": 1.0, "l1_weight": 0.0, "cos_weight": 0.0 }, "actor_layer_dims": [], "gaussian": { "enabled": false, "fixed_std": false, "init_std": 0.1, "min_std": 0.01, "std_activation": "softplus", "low_noise_eval": true }, "gmm": { "enabled": true, "num_modes": 5, "min_std": 0.0001, "std_activation": "softplus", "low_noise_eval": true }, "vae": { "enabled": false, "latent_dim": 14, "latent_clip": null, "kl_weight": 1.0, "decoder": { "is_conditioned": true, "reconstruction_sum_across_elements": false }, "prior": { "learn": false, "is_conditioned": false, "use_gmm": false, "gmm_num_modes": 10, "gmm_learn_weights": false, "use_categorical": false, "categorical_dim": 10, "categorical_gumbel_softmax_hard": false, "categorical_init_temp": 1.0, "categorical_temp_anneal_step": 0.001, "categorical_min_temp": 0.3 }, "encoder_layer_dims": [ 300, 400 ], "decoder_layer_dims": [ 300, 400 ], "prior_layer_dims": [ 300, 400 ] }, "rnn": { "enabled": true, "horizon": 10, "hidden_dim": 400, "rnn_type": "LSTM", "num_layers": 2, "open_loop": false, "kwargs": { "bidirectional": false } } }, "observation": { "modalities": { "obs": { "low_dim": [ "robot0_eef_pos", "robot0_eef_quat", "robot0_gripper_qpos", "object" ], "image": [] }, "goal": { "low_dim": [], "image": [] } }, "encoder": { "visual_core": "ResNet18Conv", "visual_core_kwargs": { "pretrained": false, "input_coord_conv": false }, "obs_randomizer_class": null, "obs_randomizer_kwargs": { "crop_height": 76, "crop_width": 76, "num_crops": 1, "pos_enc": false }, "visual_feature_dimension": 64, "use_spatial_softmax": true, "spatial_softmax_kwargs": { "num_kp": 32, "learnable_temperature": false, "temperature": 1.0, "noise_std": 0.0 } } } }

WARNING: model directory (/home/robomimic/robomimic/../tests/tmp_model_dir/bc_rnn_example) already exists! overwrite? (y/n) y REMOVING

============= Initialized Observation Utils with Obs Spec =============

using obs type: low_dim with modalities: ['robot0_gripper_qpos', 'robot0_eef_quat', 'object', 'robot0_eef_pos'] using obs type: image with modalities: []

============= Loaded Environment Metadata ============= obs modality object with shape (10,) obs modality robot0_eef_pos with shape (3,) obs modality robot0_eef_quat with shape (4,) obs modality robot0_gripper_qpos with shape (2,) ERROR: GLEW initalization error: Missing GL version

Press Enter to exit ... `

If all this works and I have built my simulation model, it requires the recording of a data set. You have used RoboTurk for this. But there is no documentation or information whether this is also usable for the public. Is it also possible to create your own dataset (including the same structure in hdf5 format) with the Robosuite script "Collect_human_demonstration"(https://robosuite.ai/docs/algorithms/demonstrations.html) and use it for training? The last question I have is how you then recorded the training data for the real robot and then tested it in the real use case with the training/algorithm result? Btw. I am using Ubuntu 20.04. Do you think that will create some problems?

Sorry for the many questions, but your framework has so many functionalities and information.

Thank you very much and best regards, Marcel

amandlek commented 2 years ago

Your first question seems to be related to rendering issues that many other robosuite / mujoco users encounter - if you continue to have trouble with this, it might be useful to search similar github issues like this one. From my personal experience, if you're using mujoco with a ubuntu machine, you need the LD_PRELOAD line if you're using on-screen rendering, but you need to make sure it's not set (e.g. run unset LD_PRELOAD) if you're using off-screen rendering, like our training code does in order to render policy rollout videos (see the render_video option in your experiment config - you can alternatively turn this option off).

Yes you can use your own datasets collected via robosuite - look at this part of the docs.

I'm a little unclear on your question about using the code for real robot training - we collected the training data for the real robot tasks separately, and then we used this codebase to train policies from that data.

We haven't tested Ubuntu 20.04, so we're not sure about any other issues you may run into.

Hope this helps!