introtodeeplearning
introtodeeplearning copied to clipboard
IndexError: too many indices for array: array is 0-dimensional, but 2 were indexed
In Lab 3 the RL_Solution for autonomous driving, always when I get to this part of the notebook:
## Render and inspect a human trace ##
vista_reset()
stream = VideoStream()
for i in tqdm(range(100)):
vista_step()
# Render and save the display
vis_img = display.render()
stream.write(vis_img[:, :, ::-1], index=i)
if car.done:
break
print("Saving trajectory of human following...")
stream.save("human_follow.mp4")
mdl.lab3.play_video("human_follow.mp4")
I got the following error stack:
/usr/local/lib/python3.8/dist-packages/ffio/ffio.py:78: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
self.image = np.fromstring(raw_image, dtype='uint8')
/usr/local/lib/python3.8/dist-packages/OpenGL/images.py:137: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
return data.tostring()
0%| | 0/100 [00:00<?, ?it/s]
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
[<ipython-input-22-221ad19af3ff>](https://localhost:8080/#) in <module>
8
9 # Render and save the display
---> 10 vis_img = display.render()
11 stream.write(vis_img[:, :, ::-1], index=i)
12 if car.done:
3 frames
[/usr/local/lib/python3.8/dist-packages/descartes/patch.py](https://localhost:8080/#) in <listcomp>(.0)
61
62 vertices = concatenate([
---> 63 concatenate([asarray(t.exterior)[:, :2]] +
64 [asarray(r)[:, :2] for r in t.interiors])
65 for t in polygon])
IndexError: too many indices for array: array is 0-dimensional, but 2 were indexed
Any idea why?
same issue here
It is a problem with the descartes
package that was last updated i think in 2017
run the following two commands
pip uninstall shapely
pip install shapely==1.8.5