Repository: voicepaw/so-vits-svc-fork

Issue:
Crash when training cluster model
**Describe the bug**
Crash when training cluster model.

**To Reproduce**
conda activate so-vits-svc-fork
cd xxx
svc train-cluster

**Additional context**
Crash log:
Loading features from dataset\44k\yyy                              train_cluster.py:24
Training clusters: 100%|█████████████████████████████████████████████████████████████████| 1/1 [00:05<00:00,  5.20s/it]
joblib.externals.loky.process_executor._RemoteTraceback:
"""
Traceback (most recent call last):
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\externals\loky\process_executor.py", line 428, in _process_worker
    r = call_item()
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\externals\loky\process_executor.py", line 275, in __call__
    return self.fn(*self.args, **self.kwargs)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\_parallel_backends.py", line 620, in __call__
    return self.func(*args, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\parallel.py", line 288, in __call__
    return [func(*args, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\parallel.py", line 288, in <listcomp>
    return [func(*args, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\so_vits_svc_fork\cluster\train_cluster.py", line 71, in train_cluster_
    return input_path.stem, train_cluster(input_path, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\so_vits_svc_fork\cluster\train_cluster.py", line 29, in train_cluster
    features = np.concatenate(features, axis=0).astype(np.float32)
  File "<__array_function__ internals>", line 180, in concatenate
ValueError: need at least one array to concatenate
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\Scripts\svc.exe\__main__.py", line 7, in <module>
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\so_vits_svc_fork\__main__.py", line 810, in train_cluster
    main(
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\so_vits_svc_fork\cluster\train_cluster.py", line 74, in main
    parallel_result = Parallel(n_jobs=-1)(
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\parallel.py", line 1098, in __call__
    self.retrieve()
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\parallel.py", line 975, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\site-packages\joblib\_parallel_backends.py", line 567, in wrap_future_result
    return future.result(timeout=timeout)
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\concurrent\futures\_base.py", line 458, in result
    return self.__get_result()
  File "C:\Users\xxx\anaconda3\envs\so-vits-svc-fork\lib\concurrent\futures\_base.py", line 403, in __get_result
    raise self._exception
ValueError: need at least one array to concatenate



Discussion:
Having the same problem as well.
@34j 3.0.4 still the same problem
Same problem here. I even tried downgrading, but the same error keeps appearing.

Resolving patch:
diff --git a/src/so_vits_svc_fork/cluster/train_cluster.py b/src/so_vits_svc_fork/cluster/train_cluster.py
--- a/src/so_vits_svc_fork/cluster/train_cluster.py
+++ b/src/so_vits_svc_fork/cluster/train_cluster.py
@@ -24,8 +24,10 @@ def train_cluster(
     LOG.info(f"Loading features from {input_dir}")
     features = []
     nums = 0
-    for path in input_dir.glob("*.soft.pt"):
-        features.append(torch.load(path).squeeze(0).numpy().T)
+    for path in input_dir.rglob("*.data.pt"):
+        features.append(
+            torch.load(path, weights_only=True)["content"].squeeze(0).numpy().T
+        )
     features = np.concatenate(features, axis=0).astype(np.float32)
     if features.shape[0] < n_clusters:
         raise ValueError(


Test patch: