acids-ircam / RAVE

Official implementation of the RAVE model: a Realtime Audio Variational autoEncoder
Other
1.35k stars 184 forks source link

Exception generating exporting a model with prior #279

Open blazejkotowski opened 10 months ago

blazejkotowski commented 10 months ago
  1. I have preprocessed the data following way: rave preprocess --channels 1 --input_path <input_path> --output_path <db_path>

  2. Then I trained the model with following command rave train --batch 2 --channels 1 --db_path <db_path> --name <run_name> --out_path <run_out> --val_every 2500 --config v2.gin

  3. Then I trained the prior rave train_prior --db_path <db_path> --name <prior_name> --out_path <prior_out_path> --val_every 2500 --gpu 0

  4. Finally, on the export with the following command rave export --name organizmo_fire --streaming true --run <run_out_path> --prior <prior_out_path> --output ts_models/

I get the following exception

Traceback (most recent call last):
  File "/miniconda/bin/rave", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/miniconda/lib/python3.11/site-packages/scripts/main_cli.py", line 38, in main
    app.run(export.main)
  File "/miniconda/lib/python3.11/site-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/miniconda/lib/python3.11/site-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
             ^^^^^^^^^^
  File "/miniconda/lib/python3.11/site-packages/scripts/export.py", line 566, in main
    scripted_rave = script_class(
                    ^^^^^^^^^^^^^
  File "/miniconda/lib/python3.11/site-packages/scripts/export.py", line 197, in __init__
    self.register_method(
  File "/miniconda/lib/python3.11/site-packages/nn_tilde/__init__.py", line 102, in register_method
    y = getattr(self, method_name)(x)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/miniconda/lib/python3.11/site-packages/scripts/export.py", line 345, in prior
    return self.prior_module.forward(temp)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/miniconda/lib/python3.11/site-packages/scripts/export.py", line 464, in forward
    x[..., i:i + 1] = self.step_forward(temp)
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File "/miniconda/lib/python3.11/site-packages/scripts/export.py", line 445, in step_forward
    self.previous_step.copy_(x.clone())
RuntimeError: output with shape [1, 128, 1] doesn't match the broadcast shape [4, 128, 1]

At the same time, I am able to export the model without prior. What is the issue?

al-jwarizmi commented 7 months ago

I have the same problem, I think @ballerburg9005 suggests to train with msprior here: https://github.com/acids-ircam/RAVE/discussions/300

But I'm not sure it works, and how.

audiophil-dev commented 5 months ago

Same error here. Has anyone managed to train and export a prior (not msprior) model that can be used with nn~, using a version of this repo later than v1?