-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
将多卡/单卡的权重保存成同一种格式;支持shell脚本中data为多个字符串的输入;修改test文件 #43
base: master
Are you sure you want to change the base?
Conversation
并且在我自己处理的时候可能一个文件夹下不全是.wav/.flac文件,因此我加入了--ext这个参数可以指定 |
@yangdongchao Hope you can review this pr |
修改后的shell脚本支持传入多个文件路径 train_data_dir="/data/LibriTTS/train-clean-100 /data/LibriTTS/train-clean-360 /data/LibriTTS/train-other-500"
valid_data_dir="/data/LibriTTS/test-clean" |
@@ -160,31 +174,26 @@ def test_batch(): | |||
print("args.target_bandwidths:", args.target_bandwidths) | |||
if not args.input.exists(): | |||
fatal(f"Input file {args.input} does not exist.") | |||
input_lists = os.listdir(args.input) | |||
input_lists = list(args.input.glob(f"**/*.{args.ext}")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里这样写的话只能读取一种格式了,不能同时读取 *.mp3 和 *.wav
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但是好像一个文件夹下很少出现这种情况(?emmm 主要是有些文件夹下有对应的音频文件和转录的文件,所以我才这么写了orz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我自己输入文件随便搞的,有各种格式,比如可以先列出所有文件,然后再把是 *.mp3 .wav,.flac 的筛选出来
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明白了,先取所有文件,然后只保留特定的mp3,flac,wav这种格式的文件
@NoFish-528 直接 train_data_dir="a b c" 在 py 里面接收到的好像是 ['a b c'], 好像必须要是, train_data_dir "a" "b" "c" ,py 接收到的才是 ['a', 'b', 'c'](必须不能有空格)?而且你还要在 py 里面处理下 train_data_dir 的读取方式?,因为原来是 str 现在是 list(str) |
但是我测试过这个应该时可以的( |
再试试吧,我这不行,最好吧 shell 的输入和 args.train_data_dir 同时列出来看看 |
okk 晚一点重新提交一下 |
self.filenames.extend(glob.glob(audio_dir + "/*.wav")) | ||
for sub_dir in audio_dir: | ||
print(sub_dir) | ||
self.filenames.extend(list(Path(sub_dir).glob("**/*.wav"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这里这样该就无法支持别的目录结构了,原始的写法是目录里面直接是 *.wav 文件,如果想支持多种类型的输入可以加判断
因为argparse的输入的input和output都是pathlib.path这个类,可以不需要引入os操作,结合官方的encodec的代码做出了以下修改