Learning To Simulate: unable to create animation
I was trying to recreate the 'learning to simulate example', and when I finished training the model and try to plot the trajectory using
python -m learning_to_simulate.render_rollout \ --rollout_path=/tmp/rollouts/WaterRamps/rollout_test_0.pkl
The error message was
Figure(1000x500) /usr/local/lib/python3.7/site-packages/matplotlib/animation.py:888: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g.anim, that exists until you have outputted the Animation using plt.show()oranim.save().
What should I do to plot the animation?
Do other regular matplotlib animations work for you (for example some animations from here), or is this specific to our own code?
If the matplotlib examples have the same issue, then it is probably something specific to you matplotlib installation.
I also encountered this problem. But I solved it, I add " unused_animation.save('animation.gif') " behind " unused_animation = animation.FuncAnimation( fig, update, frames=np.arange(0, num_steps, FLAGS.step_stride), interval=10)"
so the final code :
