marmotlab / PRIMAL2

Training code PRIMAL2 - Public Repo
MIT License
157 stars 59 forks source link

TypeError: Image data of dtype object cannot be converted to float #3

Closed orangezishuai closed 3 years ago

orangezishuai commented 3 years ago

How can I solve this problem?

input python Map_Generator2.py

output testing randomized map generation Traceback (most recent call last): File "Map_Generator2.py", line 186, in <module> plt.imshow(world) File "/home/cheng/anaconda3/envs/primal2/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2651, in imshow None else {}), **kwargs) File "/home/cheng/anaconda3/envs/primal2/lib/python3.6/site-packages/matplotlib/__init__.py", line 1565, in inner return func(ax, *map(sanitize_sequence, args), **kwargs) File "/home/cheng/anaconda3/envs/primal2/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py", line 358, in wrapper return func(*args, **kwargs) File "/home/cheng/anaconda3/envs/primal2/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py", line 358, in wrapper return func(*args, **kwargs) File "/home/cheng/anaconda3/envs/primal2/lib/python3.6/site-packages/matplotlib/axes/_axes.py", line 5615, in imshow im.set_data(X) File "/home/cheng/anaconda3/envs/primal2/lib/python3.6/site-packages/matplotlib/image.py", line 694, in set_data "float".format(self._A.dtype)) TypeError: Image data of dtype object cannot be converted to float

GilesLuo commented 3 years ago

Hi, It is a tiny error. World is a tuple that contains the obstacle map and the goal_map. I have fixed it and pushed to all the branches. Your issue is highly appreciated. Pls do not hesitate to report if you foresee any difficulty/flaw in our code.