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

AttributeError: can't set attribute - running sample.conditional_synthesis #17

Closed
icedwater opened this issue Sep 13, 2024 · 3 comments
Closed

Comments

@icedwater
Copy link

icedwater commented Sep 13, 2024

I can't seem to get the sample command to work on my end even after preparing the HumanML3D dataset. Am I missing anything obvious? The console output is below.

$ python -m sample.conditional_synthesis --model_path ./save/randomframes/model000750000.pt --edit_mode benchmark_sparse --transition_length 5 --num_samples 10 --num_repetitions 3 --text_prompt "a person throws a ball"
Loading dataset...
====DatasetConfig(name='humanml', batch_size=1, num_frames=196, split='test', hml_mode='train', use_abs3d=True, traject_only=False, use_random_projection=False, random_projection_scale=10.0, augment_type='none', std_scale_shift=[1.0, 0.0], drop_redundant=False)====
====humanml====
Reading ././dataset/humanml_opt.txt
WARNING: max_motion_length is set to 196
Loading dataset t2m ...
mode = train
t2m dataset aug: none std_scale_shift: [1.0, 0.0]
t2m dataset drop redundant information: False
--- Using small data for debugging ---
100%|███████████| 30/30 [00:00<00:00, 5428.82it/s]
Pointer Pointing at 0
Creating model and diffusion...
Using UNET with lantent dim:  512  and mults:  [2, 2, 2, 2]
dims:  [263, 1024, 1024, 1024, 1024] mults:  [2, 2, 2, 2]
[ models/temporal ] Channel dimensions: [(263, 1024), (1024, 1024), (1024, 1024), (1024, 1024)]
EMBED TEXT
Loading CLIP...
Loading checkpoints from [./save/randomframes/model000750000.pt]...
loading avg model
### Start sampling [repetitions #0]
100%|█████████████████████| 1000/1000 [00:35<00:00, 28.36it/s]
created 1 samples
### Start sampling [repetitions #1]
100%|█████████████████████| 1000/1000 [00:34<00:00, 28.69it/s]
created 2 samples
### Start sampling [repetitions #2]
100%|█████████████████████| 1000/1000 [00:33<00:00, 29.68it/s]
created 3 samples
saving results file to [save/results/randomframes/condsamples000750000__benchmark_sparse_T=5_CI=0_CRG=0_KGP=1.0_seed10_a_person_throws_a_ball/results.npy]
[(0) "Input Motion" | -> input_motion00.mp4]
Traceback (most recent call last):
  File "/home/iced/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/iced/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/iced/projects/CondMDI/sample/conditional_synthesis.py", line 314, in <module>
    main()
  File "/home/iced/projects/CondMDI/sample/conditional_synthesis.py", line 282, in main
    plot_conditional_samples(motion=all_motions,
  File "/home/iced/projects/CondMDI/data_loaders/humanml/utils/plotting.py", line 83, in plot_conditional_samples
    plot_3d_motion(animation_save_path, skeleton, gt_motion, title=caption,
  File "/home/iced/projects/CondMDI/data_loaders/humanml/utils/plot_script.py", line 242, in plot_3d_motion
    ani.save(save_path, fps=fps)
  File "/home/iced/.venv/condmdi/lib/python3.9/site-packages/matplotlib/animation.py", line 1072, in save
    anim._init_draw()  # Clear the initial frame
  File "/home/iced/.venv/condmdi/lib/python3.9/site-packages/matplotlib/animation.py", line 1727, in _init_draw
    self._draw_frame(frame_data)
  File "/home/iced/.venv/condmdi/lib/python3.9/site-packages/matplotlib/animation.py", line 1746, in _draw_frame
    self._drawn_artists = self._func(framedata, *self._args)
  File "/home/iced/projects/CondMDI/data_loaders/humanml/utils/plot_script.py", line 184, in update
    ax.lines = []
AttributeError: can't set attribute
@icedwater icedwater changed the title AttributeError: can AttributeError: can't set attribute - running sample.conditional_synthesis Sep 13, 2024
@icedwater
Copy link
Author

Also, I'm not sure why the first part tries to run using a conda environment but the error comes from my venv - this appears even after I've repeatedly done conda deactivate.

@icedwater
Copy link
Author

icedwater commented Sep 16, 2024

This workaround helped me to get the video generated, though now the frames aren't cleared and the generated motion is messy. (Edit: it was because I forgot to add the ax.clear() line. Now the frames are cleared.)

@setarehc
Copy link
Owner

Yes, this is related to the matplotlib version you're using. I use matplotlib 3.1.3 and the code works fine.
Glad to hear the workaround suggested for the issue you posted, resolved the problem.

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

2 participants