MaxDu17 / BehaviorRetrieval

Code for the Behavior Retrieval Paper
31 stars 4 forks source link

Fail to collect data #2

Open davidkillerhahaha opened 1 year ago

davidkillerhahaha commented 1 year ago

Hi Max! I tried to collect data for square task and office task, but both failed for the reason of missing trained model such as bc_trained_models/can_paired_image_selected_BC/fixed_goal_conditioned_baseline1/model_epoch_$checkpoint.pth. I cannot find the subfolder dataset in the project and did I miss something important here ? Thanks!

MaxDu17 commented 1 year ago

Hi! Thanks for reaching out--this is interesting. Just to confirm, you were running something along the lines of

python run_trained_agent.py \
  --agent SquarePeg \
  --eval_path datasets/square_machine_policy/ \
  --reference_data datasets/square/ph/image.hdf5 \
  --config configs/image_collection.json \
  --machine_oracle --success_only --dataset_obs \
  --dataset_path datasets/square_machine_policy/square_10_good.hdf5 \
  --n_rollouts 10 --horizon 400 --seed 11

The run_trained_agent needs a checkpoint if --machine_oracle is not passed in. Otherwise, it should default to the machine policy (if this is not the case, please let me know--that would definitely be a mistake on my end)

ZlSong417 commented 1 year ago

@davidkillerhahaha Hi,Have you solved the problem? I need your help. Thanks.

MaxDu17 commented 1 year ago

Hi! Can you give more details about your particular setup? This might be a problem on my end, but it should have a very easy fix

ZlSong417 commented 1 year ago

@MaxDu17 Hi!MAX,When I run run_trained_agent.py,error appear: Ubuntu18.04 python3.7 robosuite1.2 robomimic0.2.0 (BR) szl@szl-virtual-machine:~/BehaviorRetrieval$ python run_trained_agent.py --agent SquarePeg --eval_path datasets/square_machine_policy/ --reference_data datasets/square/ph/image.hdf5 --config configs/image_collection.json --machine_oracle --success_only --dataset_obs --dataset_path datasets/square_machine_policy/square_10_good.hdf5 --n_rollouts 10 --horizon 400 --seed 11 Created environment with name PickPlaceCan Action size is 7

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

using obs modality: low_dim with keys: ['robot0_eef_quat', 'robot0_eef_pos', 'object', 'robot0_gripper_qpos'] using obs modality: rgb with keys: ['agentview_image', 'robot0_eye_in_hand_image'] using obs modality: depth with keys: [] using obs modality: scan with keys: [] Traceback (most recent call last): File "run_trained_agent.py", line 536, in run_trained_agent(args) File "run_trained_agent.py", line 294, in run_trained_agent data_writer = h5py.File(args.dataset_path, "w") File "/home/szl/anaconda3/envs/BR/lib/python3.7/site-packages/h5py/_hl/files.py", line 567, in init fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr) File "/home/szl/anaconda3/envs/BR/lib/python3.7/site-packages/h5py/_hl/files.py", line 237, in make_fid fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5f.pyx", line 126, in h5py.h5f.create FileNotFoundError: [Errno 2] Unable to create file (unable to open file: name = 'datasets/square_machine_policy/square_10_good.hdf5', errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 242)

What makes this error? Hope some tips,thanks.

MaxDu17 commented 1 year ago

Have you tried creating the datasets/square_machine_policy folder before running the script? It might be having some difficulty with recursive file creation

ZlSong417 commented 1 year ago

Thanks for your advice, I have successfully created datasets/square_machine_policy.