ur_openai_gym icon indicating copy to clipboard operation
ur_openai_gym copied to clipboard

TypeError: __init__() got an unexpected keyword argument 'actor_class'

Open ammar-n-abbas opened this issue 1 year ago • 8 comments

Hi,

while running the training files through rosrun as defined in the readme, I am getting this error:

  **File "~/catkin_ws/src/ur_openai_gym/ur_rl/scripts/tf2rl_sac.py", line 83, in <module>**
    policy = SAC(
  File "~.local/lib/python3.8/site-packages/tf2rl/algos/sac.py", line 50, in __init__
    super().__init__(
  File "~/.local/lib/python3.8/site-packages/tf2rl/algos/policy_base.py", line 86, in __init__
    super().__init__(memory_capacity=memory_capacity, **kwargs)
**TypeError: __init__() got an unexpected keyword argument 'actor_class'**

ammar-n-abbas avatar Aug 15 '23 09:08 ammar-n-abbas

Hi,

Are you using the docker version or did you install it from source?

In any case, the problem seems to be the version of the tf2rl library. Make sure you are using this version https://github.com/cambel/tf2rl/tree/dev (the dev branch)

cambel avatar Aug 18 '23 08:08 cambel

@cambel thank you for your reply. The issue is resolved with your branch

However, now it shows this error:

''' GYM Environment:simulation/task_space.yaml Grasping pluging can't be loaded ft_sensor: False, ee_link: tool0, robot_urdf: ur3e [ WARN] [1692696708.704822850]: link 'robotiq_coupler' material 'flat_black' undefined. [ WARN] [1692696708.704878883]: link 'robotiq_coupler' material 'flat_black' undefined. [ WARN] [1692696708.713430526]: link 'robotiq_coupler' material 'flat_black' undefined. [ WARN] [1692696708.713589309]: link 'robotiq_coupler' material 'flat_black' undefined. connecting to: /scaled_pos_joint_traj_controller/command ACTION SPACES TYPE Box(6,) OBSERVATION SPACES TYPE Box(12,) Segmentation fault (core dumped) '''

ammar-n-abbas avatar Aug 22 '23 09:08 ammar-n-abbas

That may be a problem with the python cpprb library. Please re-install the library to this specific version pip install cpprb==10.0.0

cambel avatar Aug 23 '23 05:08 cambel

@cambel thanks a lot this error is resolved now.

Getting this attribute error

AttributeError: module 'ur_control.transformations' has no attribute 'pose_from_angular_veloticy'

ammar-n-abbas avatar Aug 23 '23 06:08 ammar-n-abbas

@ammar-n-abbas Sorry about that, I don't have time right now to fix the issues with this repo. But I have a hopefully working example here. It is self-contained so you shouldn't have the error from above that just means incompatibility with a dependency.

cambel avatar Sep 20 '23 12:09 cambel

@cambel you are right, it was due to tensorflow and tensorflow_probability compatibility issues it's working fine now.

Thanks

Thank you for sharing another work example, really interesting...

ammar-n-abbas avatar Sep 20 '23 12:09 ammar-n-abbas

glad it works for you now

cambel avatar Sep 20 '23 23:09 cambel

what version of tensorflow and tensorflow_probabilty are you using? I have the same problem

pvela2017 avatar Mar 13 '24 13:03 pvela2017