cambel / ur_openai_gym

OpenAI Gym interface for Universal Robots with ROS Gazebo
MIT License
16 stars 2 forks source link

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

Open ammar-n-abbas opened 1 year ago

ammar-n-abbas commented 1 year ago

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'**
cambel commented 1 year ago

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)

ammar-n-abbas commented 1 year ago

@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) '''

cambel commented 1 year ago

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

ammar-n-abbas commented 1 year ago

@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'

cambel commented 1 year ago

@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.

ammar-n-abbas commented 1 year ago

@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...

cambel commented 1 year ago

glad it works for you now

pvela2017 commented 8 months ago

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