OpenAI gym:将gym运行过程保存为gif
执行CartPole-v1程序,并将运行过程存储为gif参考链接参考1参考2代码:import gymimport matplotlib.pyplot as pltfrom matplotlib import animationdef display_frames_as_gif(frames): patch = plt.imshow(frames[0]) plt.axis("off") def animate(i): patch.set_dat