vits_chinese
vits_chinese copied to clipboard
请教一个关于【迁移】项目的问题
我讲该项目移植到其他项目中,作为工具使用。
文件报错vits_chinese\monotonic_align\__init__.py", line 3, in <module>
from tools.vits_chinese.monotonic_align.core import maximum_path_c ModuleNotFoundError: No module named 'tools.vits_chinese.monotonic_align.core'
因为迁移的问题,很多文件的导入,使用了绝对路径。
`import numpy as np
import torch
from tools.vits_chinese.monotonic_align.core import maximum_path_c
def maximum_path(neg_cent, mask): """Cython optimized version. neg_cent: [b, t_t, t_s] mask: [b, t_t, t_s] """ device = neg_cent.device dtype = neg_cent.dtype neg_cent = neg_cent.data.cpu().numpy().astype(np.float32) path = np.zeros(neg_cent.shape, dtype=np.int32)
t_t_max = mask.sum(1)[:, 0].data.cpu().numpy().astype(np.int32)
t_s_max = mask.sum(2)[:, 0].data.cpu().numpy().astype(np.int32)
maximum_path_c(path, neg_cent, t_t_max, t_s_max)
return torch.from_numpy(path).to(device=device, dtype=dtype)`
我好奇的时,为什么该文件的引入会找不到?