aik2mlj / polyffusion

Polyffusion: A Diffusion Model for Polyphonic Score Generation with Internal and External Controls
https://polyffusion.github.io
MIT License
71 stars 8 forks source link

Inference errors, e.g. "Missing key model_name" #6

Closed drscotthawley closed 5 months ago

drscotthawley commented 5 months ago

Hi, when running the first suggested example for inference,...

python polyffusion/inference_sdf.py --chkpt_path=/path/to/checkpoint --uncond_scale=0. --length=10

I downloaded the checkpoint, placed in result/ as directed, and run this:

python polyffusion/inference_sdf.py --chkpt_path=result/sdf+pop909wm_mix16_chd8bar/01-11_102022/chkpts --uncond_scale=0. --length=10

which gives the error:

Traceback (most recent call last):
  File "/home/shawley/diffusion/polyffusion/polyffusion/inference_sdf.py", line 526, in <module>
    raise FileNotFoundError(
FileNotFoundError: params.yaml or params.json not found in result/sdf+pop909wm_mix16_chd8bar, please specify custom_params_path then.

After this I try

python polyffusion/inference_sdf.py --chkpt_path=result/sdf+pop909wm_mix16_chd8bar/01-11_102022/chkpts --uncond_scale=0. --length=10  --custom_params_path=result/sdf+pop909wm_mix16_chd8bar/01-11_102022/params.yaml 

which gives this error:

Traceback (most recent call last):
  File "/home/shawley/diffusion/polyffusion/polyffusion/inference_sdf.py", line 533, in <module>
    model_label = params.model_name
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/base.py", line 231, in _format_and_raise
    format_and_raise(
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/_utils.py", line 899, in format_and_raise
    _raise(ex, cause)
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/_utils.py", line 797, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 351, in __getattr__
    return self._get_impl(
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 442, in _get_impl
    node = self._get_child(
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "/home/shawley/envs/hs/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 480, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key model_name
    full_key: model_name
    object_type=dict

The inference instructions in the README didn't include a model name. ...Is there a way to make this work? Thanks.

drscotthawley commented 5 months ago

Ok, the following works:

python polyffusion/inference_sdf.py --chkpt_path=result/sdf+pop909wm_mix16_chd8bar/01-11_102022/chkpts/weights.pt --uncond_scale=0. --length=10  --custom_params_path=result/sdf+pop909wm_mix16_chd8bar/01-11_102022/params.yaml 

Closing.