Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I run this command, the programme errors out. "python -m sample.generate --model_path ./save/humanml_trans_enc_512/model000200000.pt --num_samples 10 --num_repetitions 3" #171

Open
imustwangxin opened this issue Nov 15, 2023 · 2 comments

Comments

@imustwangxin
Copy link

(wangxin_mdm) [phdcv@localhost motion-diffusion-model]$ python -m sample.generate --model_path ./save/humanml_trans_enc_512/model000200000.pt --num_samples 10 --num_repetitions 3
Loading dataset...
Reading ././dataset/humanml_opt.txt
Loading dataset t2m ...
100%|████████████████████████████████████████████| 4384/4384 [00:00<00:00, 18551.49it/s]
Creating model and diffusion...
TRANS_ENC init
EMBED TEXT
Loading CLIP...
Loading checkpoints from [./save/humanml_trans_enc_512/model000200000.pt]...

Sampling [repetitions #0]

100%|███████████████████████████████████████████████| 1000/1000 [01:54<00:00, 8.70it/s]
created 10 samples

Sampling [repetitions #1]

100%|███████████████████████████████████████████████| 1000/1000 [01:45<00:00, 9.44it/s]
created 20 samples

Sampling [repetitions #2]

100%|███████████████████████████████████████████████| 1000/1000 [01:48<00:00, 9.18it/s]
created 30 samples
saving results file to [./save/humanml_trans_enc_512/samples_humanml_trans_enc_512_000200000_seed10/results.npy]
saving visualizations to [./save/humanml_trans_enc_512/samples_humanml_trans_enc_512_000200000_seed10]...
["a person remained sitting down." (00) | Rep #00 | -> sample00_rep00.mp4]
MovieWriter stderr:
[libopenh264 @ 0x5623a54cd380] Incorrect library version loaded
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Traceback (most recent call last):
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 230, in saving
yield self
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 1156, in save
writer.grab_frame(**savefig_kwargs)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 384, in grab_frame
dpi=self.dpi, **savefig_kwargs)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/figure.py", line 2180, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2091, in print_figure
**kwargs)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 446, in print_raw
fh.write(renderer._renderer.buffer_rgba())
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/phdcv/wangxin/motion-diffusion-model/sample/generate.py", line 269, in
main()
File "/home/phdcv/wangxin/motion-diffusion-model/sample/generate.py", line 201, in main
plot_3d_motion(animation_save_path, skeleton, motion, dataset=args.dataset, title=caption, fps=fps)
File "/home/phdcv/wangxin/motion-diffusion-model/data_loaders/humanml/utils/plot_script.py", line 128, in plot_3d_motion
ani.save(save_path, fps=fps)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 1156, in save
writer.grab_frame(**savefig_kwargs)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/contextlib.py", line 130, in exit
self.gen.throw(type, value, traceback)
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 232, in saving
self.finish()
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 367, in finish
self.cleanup()
File "/home/phdcv/phdcvssd1/anaconda3/envs/wangxin_mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 411, in cleanup
self._proc.returncode, self._proc.args, out, err)
subprocess.CalledProcessError: Command '['ffmpeg', '-f', 'rawvideo', '-vcodec', 'rawvideo', '-s', '300x300', '-pix_fmt', 'rgba', '-r', '20', '-loglevel', 'error', '-i', 'pipe:', '-vcodec', 'h264', '-pix_fmt', 'yuv420p', '-y', './save/humanml_trans_enc_512/samples_humanml_trans_enc_512_000200000_seed10/sample00_rep00.mp4']' returned non-zero exit status 1.

@GuyTevet
Copy link
Owner

seems you have an ffmpeg issue

MovieWriter stderr:
[libopenh264 @ 0x5623a54cd380] Incorrect library version loaded
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

@shawkontzu
Copy link

shawkontzu commented Dec 22, 2023

This is due to incompatible ffmpeg version in your conda env, your conda env has a default ffmpeg, you might installed another ffmpeg outside your conda env (on ubuntu it's at '/user/bin/ffmpeg'). Just check which ffmpeg you are running in your conda env by running
which ffmpeg
I have ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0) in my conda env and
ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) system wise.

solution:
inside "motion-diffusion-model/data_loaders/humanml/utils/plot_script.py" add
plt.rcParams['animation.ffmpeg_path'] = '/usr/bin/ffmpeg' right after you import matplotlib, forcing matplotlib to use system-wise ffmpeg fixed this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants