DensePhysNet-Simulation icon indicating copy to clipboard operation
DensePhysNet-Simulation copied to clipboard

AttributeError: 'tuple' object has no attribute 'astype'

Open prograguo opened this issue 5 years ago • 1 comments

Dear teacher: when i run python sim.py --step 10 Traceback (most recent call last): File "sim.py", line 392, in generate_data() File "sim.py", line 246, in generate_data image_RGB_ini, image_depth_ini, _ = cam.get_data() File "/home/guocheng/DensePhysNet-Simulation/simCamera.py", line 22, in get_data d = img_arr[3].astype(np.float32) AttributeError: 'tuple' object has no attribute 'astype' numActiveThreads = 0 Can you tell me what issue i meet? thanks!

prograguo avatar Jan 20 '21 05:01 prograguo

This is because you are using the latest version of Pybullet, instead of the one listed in requirements.txt. (pybullet==2.6.4) In the latest version, you need to manually convert it into a numpy array. For example: d = np.array(img_arr[3], dtype=np.float32).reshape([h, w])

zhenjia-xu avatar Jan 20 '21 06:01 zhenjia-xu