PKU-EPIC / DexGraspNet

147 stars 17 forks source link

ValueError: exactly one among 'object_code_list' 'all' should be specified #2

Closed Charlie0257 closed 1 year ago

Charlie0257 commented 1 year ago

When I run the command python scripts/generate_grasps.py, there is an error occurs——

Traceback (most recent call last): File "scripts/generate_grasps.py", line 213, in raise ValueError('exactly one among \'object_code_list\' \'all\' should be specified')

Thanks for any help :)

mzhmxzh commented 1 year ago

Try running the script with command cd grasp_generation; CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python scripts/generate_grasps.py --all. This will generate grasps for all objects in data/meshdata.

If you want to specify a list of objects, try cd grasp_generation; CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python scripts/generate_grasps.py --object_code_list object_code_1 object_code_2 object_code_3.

Furthermore, you can specify a todo list todo.txt and inform the script by setting the flag --todo.

We will clarify this in the comments of the script soon.

Charlie0257 commented 1 year ago

Thanks for your replying! I can run the command python scripts/generate_grasps.py --all now :)

However, when I try to validate the result python scripts/validate_grasps.py, there is an error occurs—— Traceback (most recent call last): File "scripts/validate_grasps.py", line 74, in hand_model = HandModel( TypeError: init() missing 2 required positional arguments: 'contact_points_path' and 'penetration_points_path'

Could you offer a detailed demo commend to tell me how to input the correct parameters for this command?

Thanks :) @mzhmxzh

mzhmxzh commented 1 year ago

There seems to be a bug with code consistency. It should be fine now. You can run the command (cd grasp_generation; python scripts/validate_grasps.py) in the newest commit, and use the arguments --object_code and --gpu to specify the object and gpu. Thank you for pointing this out! :)

Charlie0257 commented 1 year ago

Thanks for your help :) However, there is another error occurs when running python scripts/validate_grasps.py——

Traceback (most recent call last): File "scripts/validate_grasps.py", line 150, in E_pen_array.append(data_dict[i]["E_pen"]) KeyError: 'E_pen'

Could you give me some help? @mzhmxzh

mzhmxzh commented 1 year ago

Hmm... This is strange indeed.

grasp_generation/main.py and grasp_generation/scripts/generate_grasps.py both record E_pen, because penetration depth is a validation metric. But this value is discarded after validation to reserve space. If grasp_generation/scripts/generate_grasps.py outputs correctly to data/graspdata, and grasp_generation/scripts/validate_grasps.py reads correctly from data/graspdata, there shouldn't be a KeyError.

I'm guessing that you passed the sample files in data/dataset to the validation script? These are the outputs of grasp_generation/scripts/validate_grasps.py, so they no longer contain E_pen or qpos_st (the initial hand pose). Try running generate_grasps.py first and then run validate_grasps.py.

Good luck! We are happy to provide further clarifications if needed. :)

Charlie0257 commented 1 year ago

Thanks for your patient answers :) All codes are currently working fine!

I am curious if it is possible to visualize the effect of validation in isaacgym during the validation phase when I run python scripts/validate_grasps.py?

wrc042 commented 1 year ago

You can turn on a GUI window of Isaac Gym by adding an argument, python scripts/validate_grasps.py --index 0. This will display the object you specified. If you want to watch multiple objects in a window, I think you can modify our script to do so.

Charlie0257 commented 1 year ago

Thanks :)