Skip to content

Commit

Permalink
feat(__main__): add an option to launch tensorboard in train command (
Browse files Browse the repository at this point in the history
  • Loading branch information
34j authored Mar 27, 2023
1 parent 80b7f46 commit ef22cce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ pip install -U torch torchaudio --index-url https://download.pytorch.org/whl/cu1
pip install -U so-vits-svc-fork
```

- If you are using an AMD GPU on Linux, replace `--index-url https://download.pytorch.org/whl/cu117` with `--index-url https://download.pytorch.org/whl/rocm5.4.2`.
- If no GPU is available, simply remove `pip install -U torch torchaudio --index-url https://download.pytorch.org/whl/cu117`.
- If `fairseq` raises an error that [`Microsoft C++ Build Tools`](https://visualstudio.microsoft.com/visual-cpp-build-tools/) is not installed or that some dll is missing, please (re)install it.
- If you are using an AMD GPU on Linux, replace `--index-url https://download.pytorch.org/whl/cu117` with `--index-url https://download.pytorch.org/whl/rocm5.4.2`. AMD GPUs are not supported on Windows (#120).
- If `fairseq` raises an error:
- If it prompts [`Microsoft C++ Build Tools`](https://visualstudio.microsoft.com/visual-cpp-build-tools/) is not installed. please install it.
- If it prompts that some dll is missing, reinstalling `Microsoft Visual C++ 2022` and `Windows SDK` may help.

### Update

Expand Down Expand Up @@ -132,14 +134,14 @@ Place your dataset like `dataset_raw/{speaker_id}/**/{wav_file}.{any_format}` (s
svc pre-resample
svc pre-config
svc pre-hubert
svc train
svc train -t
```

#### Notes

- Dataset audio duration per file should be <~ 10s or VRAM will run out.
- To change the f0 inference method to CREPE, replace `svc pre-hubert` with `svc pre-hubert -fm crepe`. You may need to reduce `--n-jobs` due to performance issues.
- It is recommended to change the batch_size in `config.json` before the `train` command to match the VRAM capacity. As tested, the default requires about 14 GB.
- It is recommended to change the batch_size in `config.json` before the `train` command to match the VRAM capacity. The default value is optimized for Tesla T4 (16GB VRAM), but training is possible without that much VRAM.
- Silence removal and volume normalization are automatically performed (as in the upstream repo) and are not required.

### Further help
Expand Down
21 changes: 20 additions & 1 deletion src/so_vits_svc_fork/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,32 @@ def cli():
help="path to output dir",
default=Path("./logs/44k"),
)
def train(config_path: Path, model_path: Path):
@click.option(
"-t/-nt",
"--tensorboard/--no-tensorboard",
default=False,
type=bool,
help="launch tensorboard",
)
def train(config_path: Path, model_path: Path, tensorboard: bool = False):
"""Train model
If D_0.pth or G_0.pth not found, automatically download from hub."""
from .train import train

config_path = Path(config_path)
model_path = Path(model_path)

if tensorboard:
import webbrowser

from tensorboard import program

getLogger("tensorboard").setLevel(30)
tb = program.TensorBoard()
tb.configure(argv=[None, "--logdir", model_path.as_posix()])
url = tb.launch()
webbrowser.open(url)

train(config_path=config_path, model_path=model_path)


Expand Down

0 comments on commit ef22cce

Please sign in to comment.