JiatongBao / DRLSorting

Learn Multi-Step Object Sorting Tasks through Deep Reinforcement Learning
BSD 2-Clause "Simplified" License
5 stars 1 forks source link

Trouble during run #3

Open hasubasic opened 3 months ago

hasubasic commented 3 months ago

Hi JiatongBao, i tried to run this code, but i had few issues.

One of them was this one: Traceback (most recent call last): File "/home/hs/DRLSorting/main.py", line 768, in main(args) File "/home/hs/DRLSorting/main.py", line 30, in main disturb_num = args.disturb_num ^^^^^^^^^^^^^^^^ AttributeError: 'Namespace' object has no attribute 'disturb_num'

After that i put comment on line 31 and on line 363 and 364 then i got more issues>

Connected to simulation. Traceback (most recent call last): File "/home/hs/DRLSorting/main.py", line 768, in main(args) File "/home/hs/DRLSorting/main.py", line 77, in main robot = Robot(is_sim, obj_mesh_dir, num_obj, fixed_color, workspace_limits, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hs/DRLSorting/robot.py", line 83, in init self.setup_sim_camera() File "/home/hs/DRLSorting/robot.py", line 218, in setup_sim_camera self.bg_color_img, self.bg_depth_img = self.get_camera_data() ^^^^^^^^^^^^^^^^^^^^^^ File "/home/hs/DRLSorting/robot.py", line 387, in get_camera_data color_img = color_img.astype(np.float)/255 ^^^^^^^^ File "/home/hs/anaconda3/lib/python3.12/site-packages/numpy/init.py", line 324, in getattr raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?

Could you help me with this? Thanks

DucNguyenAIML commented 3 months ago

Hi JiatongBao, i tried to run this code, but i had few issues.

One of them was this one: Traceback (most recent call last): File "/home/hs/DRLSorting/main.py", line 768, in main(args) File "/home/hs/DRLSorting/main.py", line 30, in main disturb_num = args.disturb_num ^^^^^^^^^^^^^^^^ AttributeError: 'Namespace' object has no attribute 'disturb_num'

After that i put comment on line 31 and on line 363 and 364 then i got more issues>

Connected to simulation. Traceback (most recent call last): File "/home/hs/DRLSorting/main.py", line 768, in main(args) File "/home/hs/DRLSorting/main.py", line 77, in main robot = Robot(is_sim, obj_mesh_dir, num_obj, fixed_color, workspace_limits, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hs/DRLSorting/robot.py", line 83, in init self.setup_sim_camera() File "/home/hs/DRLSorting/robot.py", line 218, in setup_sim_camera self.bg_color_img, self.bg_depth_img = self.get_camera_data() ^^^^^^^^^^^^^^^^^^^^^^ File "/home/hs/DRLSorting/robot.py", line 387, in get_camera_data color_img = color_img.astype(np.float)/255 ^^^^^^^^ File "/home/hs/anaconda3/lib/python3.12/site-packages/numpy/init.py", line 324, in getattr raise AttributeError(former_attrs[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?

Could you help me with this? Thanks

Hello. I'm not Jiatongbao. However, I have experience in working on his project. You can try my solution. The first one, disturb_num is nomally a "White variable". It means disturb_num takes no affect to the program. So you can normally give it value zero (disturb_num = 0)

Second, with numpy version 1.20 or higher, the command np.float is deprecated and can not be used anymore. You have 2 solutions to solve this problem:

  1. Uninstall your numpy and reinstall the previous version of numpy, which can use np.float pip install --force-reinstall numpy==1.xx.xx

  2. You use np.float64 instead of np.float

P/s: My English is not perfect, I'm still learning, if you don't understand any information, feel free to ask again.

hasubasic commented 2 months ago

Hi DucNguyenAIML,

thank you form your comment. I was able to run this code.