deepmind-research icon indicating copy to clipboard operation
deepmind-research copied to clipboard

Learning To Simulate: unable to create animation

Open Sir-Teo opened this issue 3 years ago • 2 comments

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?

Sir-Teo avatar Jun 28 '22 04:06 Sir-Teo

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.

alvarosg avatar Aug 04 '22 17:08 alvarosg

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 : image

X1ngyu avatar Apr 20 '23 15:04 X1ngyu