raisimTech / raisimLib

Visit www.raisim.com
http://www.raisim.com
Other
341 stars 93 forks source link

Issue with Tester.py in RaisimGymTorch "Anymal locomotion" Example #446

Closed nabeeljadoon closed 1 year ago

nabeeljadoon commented 1 year ago

Dear Members, I am new to raisim and robotics and trying to run the tester.py in anymal locomotion examples. I have managed to run runner.py successfully and weights are saved in data>anymal locomotion folder as .pt files extensions. However, I am trying to test the robot but an error occurred that the iteration index is out of range first.

Here is the code: ob_dim = env.num_obs act_dim = env.num_acts

weight_path = args.weight iteration_number = weightpath.rsplit('/', 1)[1].split('', 1)[1].rsplit('.', 1)[0] weight_dir = weight_path.rsplit('/', 1)[0] + '/'

if weight_path == "C://Users/nabee/Raisim_ws/raisimGymTorch/data/anymal_locomotion/": print("Can't find trained weight, please provide a trained weight with --weight switch\n") else: print("Loaded weight from {}\n".format(weight_path)) start = time.time() env.reset()

Here is the error message: S C:\Users\nabee\Raisim_ws\raisimGymTorch>

                                      > & C:/Users/nabee/anaconda3/python.exe c:/Users/nabee/Raisim_ws/raisimGymTorch/raisimGymTorch/env/envs/rsg_anymal/tester.py

Traceback (most recent call last): File "c:\Users\nabee\Raisim_ws\raisimGymTorch\raisimGymTorch\env\envs\rsg_anymal\tester.py", line 34, in iteration_number = weightpath.rsplit('/', 1)[1].split('', 1)[1].rsplit('.', 1)[0] IndexError: list index out of range [2023:04:02:02:11:22 RaisimServer.hpp:226] Connection to 296 is established

Moreover, I am trying to include the weight path. Please also mention that if that is correct way or do I have to mention something like full_1000.pt etc?

I would really appreciate your time and support.

jhwangbo commented 1 year ago

There is a readme included. You should run it as python ./tester.py -w <the weight full pt file>

nabeeljadoon commented 1 year ago

Thank you for your response. The issue is has been resolved as suggested by you.

On Tue, Apr 4, 2023, 19:16 Jemin Hwangbo @.***> wrote:

There is a readme included. You should run it as python ./tester.py -w

— Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you authored the thread.Message ID: ***@***.***>