Update utils.py

This commit is contained in:
YuriHead 2023-07-06 23:42:08 +08:00 committed by GitHub
parent 136b230850
commit d2ae02c24e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ def load_checkpoint(checkpoint_path, model, optimizer=None, skip_optimizer=False
# print("load", k)
new_state_dict[k] = saved_state_dict[k]
assert saved_state_dict[k].shape == v.shape, (saved_state_dict[k].shape, v.shape)
except AssertionError:
except Exception:
print("error, %s is not in the checkpoint" % k)
logger.info("%s is not in the checkpoint" % k)
new_state_dict[k] = v
@ -483,7 +483,7 @@ def train_index(spk_name,root_dir = "dataset/44k/"): #from: RVC https://github.
.fit(big_npy)
.cluster_centers_
)
except ValueError:
except Exception:
info = traceback.format_exc()
print(info)
n_ivf = min(int(16 * np.sqrt(big_npy.shape[0])), big_npy.shape[0] // 39)