Open ldv1 opened 12 months ago
Note: This is from https://github.com/pyvista/pyvista/discussions/5114 .
- One issue is that we should have
plotter = pv.Plotter(off_screen=True)
I remember this not being required in the past, so this might be an actual bug?
off_scren
is not required for this. The trick might be to use the q
key to close the plotter (not the exit button) so that the after the show(auto_close=False)
line, the rest executes, generating the movie. I believe this behavior can vary depending on system
This example works fine for me locally.
users should be informed about this issue, and advised to install imageio with the ffmpeg option
Agreed
off_scren
is not required for this. The trick might be to use the q key to close the plotter
If I press 'q', then I get
File "/home/myname/movie.py", line 22, in <module>
plotter.write_frame() # write initial data
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyvista/plotting/plotter.py", line 5018, in write_frame
self.mwriter.append_data(self.image)
File "/usr/lib/python3.11/site-packages/imageio/core/format.py", line 572, in append_data
self._checkClosed()
File "/usr/lib/python3.11/site-packages/imageio/core/format.py", line 364, in _checkClosed
raise RuntimeError(msg)
RuntimeError: I/O operation on closed Writer.
It is unclear to me how to get past the plot window (on linux) without getting an error.
Anyway, off_screen=True
works fine for me.
If I recall correctly, there are some system-specific issues and sometimes we have to close the plotter (thus also closing the imagio writer) when the exit button or q is pressed. I'll try to reproduce this when I have a chance as there is likely a workaround
Hi: My environment is Ubuntu 22.04, The error message for running stable video is as follows: Sampler: EulerEDMSampler Discretization: EDMDiscretization Guider: LinearPredictionGuider Sampling with EulerEDMSampler for 26 steps: 0%| | 0/26 [00:00<?, ?it/s]/usr/local/lib/python3.10/dist-packages/torch/utils/checkpoint.py:31: UserWarning: None of the inputs have requires_grad=True. Gradients will be None warnings.warn("None of the inputs have requires_grad=True. Gradients will be None") Sampling with EulerEDMSampler for 26 steps: 96%|████████████████████████████████████████████████████▉ | 25/26 [00:41<00:01, 1.67s/it] 2024-03-25 10:49:21.284 Uncaught app exception Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script exec(code, module.dict) File "/home/generative-models/scripts/demo/video_sampling.py", line 280, in save_video_as_grid_and_mp4(samples, save_path, T, fps=saving_fps) File "/home/generative-models/scripts/demo/streamlit_helpers.py", line 912, in save_video_as_grid_and_mp4 imageio.mimwrite(video_path, vid, fps=fps) File "/usr/local/lib/python3.10/dist-packages/imageio/v2.py", line 495, in mimwrite return file.write(ims, is_batch=True, kwargs) File "/usr/local/lib/python3.10/dist-packages/imageio/plugins/tifffile_v3.py", line 224, in write self._fh.write(image, kwargs) TypeError: TiffWriter.write() got an unexpected keyword argument 'fps'
Describe the bug, what's wrong, and what you expected.
The movie.py example does not work. There are two issues:
plotter = pv.Plotter(off_screen=True)
plotter.write_frame()
will trigger the error messageTypeError: TiffWriter.write() got an unexpected keyword argument fps
imageio with the tifffile option is not currently supported by pyvista. At least, users should be informed about this issue, and advised to install imageio with the ffmpeg option as inpip install imageio[ffmpeg]==2.31.4
. This advise could appear at the bottom of the example.Steps to reproduce the bug.
System Information
Screenshots
No response