bshall / acoustic-model

Acoustic models for: A Comparison of Discrete and Soft Speech Units for Improved Voice Conversion
https://bshall.github.io/soft-vc/
MIT License
98 stars 24 forks source link

Bug: Training crash with missing argument `discrete` #4

Closed tarepan closed 2 years ago

tarepan commented 2 years ago

Summary

AcousticModel training by train.py crash with missing attribute error.
It is caused by missing parsearg attribute discrete.
It can be fixed with additional argument, so I made a pull request (https://github.com/bshall/acoustic-model/pull/5).

Phenomena

When run train.py with proper dataset-dir and checkpoint-dir, it crash.
Error message argue that the attribute discrete is missing.

Error Message

-- Process 0 terminated with the following error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
    fn(i, *args)
  File "/content/softVC_AM/train.py", line 96, in train
    discrete=args.discrete,
AttributeError: 'Namespace' object has no attribute 'discrete'

Cause

In train.py, there is a argument usage args.discrete, but there is no corresponding parser.add_argument.
https://github.com/bshall/acoustic-model/blob/df6eba987d8200d70f77d391eeadc2aa5cd1f237/train.py#L87-L91

Fix idea

As in paper, softVC-AM seems to support both soft and discrete.
So we can add discrete flag (by default, it works as soft mode).
When I add it, the bug disappear.

Notes

I make a pull request (https://github.com/bshall/acoustic-model/pull/5) which will fix this bug.

Thanks for your great OSS! I am happy if this help you and community.