การใช้ Pytorch อย่างไม่เป็นทางการของ LightSpeech: ข้อความที่มีน้ำหนักเบาและรวดเร็วในการพูดด้วยการค้นหาสถาปัตยกรรมประสาท repo นี้ใช้การใช้งาน Fastspeech 2 ของ ESPNET เป็นฐาน repo นี้ใช้เฉพาะรุ่นสุดท้ายของรุ่น Lightspeech ไม่ใช่การค้นหาสถาปัตยกรรมระบบประสาทตามที่กล่าวไว้ในกระดาษ
But I am able to compress only 3x (from 27 M to 7.99 M trainable parameters) not 15x
รหัสทั้งหมดที่เขียนใน Python 3.6.2
ก่อนที่จะติดตั้ง pytorch โปรดตรวจสอบเวอร์ชัน cuda ของคุณโดยเรียกใช้คำสั่งต่อไปนี้:
nvcc --version
pip install torch torchvision
ใน repo นี้ฉันได้ใช้ pytorch 1.6.0 สำหรับคุณสมบัติ torch.bucketize ซึ่งไม่ได้อยู่ใน Pytorch เวอร์ชันก่อนหน้า
pip install -r requirements.txt
tensorboard version 1.14.0 Seperatly พร้อม tensorflow (1.14.0) โฟลเดอร์ filelists ประกอบด้วย MFA (Motreal Force Aligner) ไฟล์ชุดข้อมูล LJSpeech ที่ประมวลผลดังนั้นคุณไม่จำเป็นต้องจัดเรียงข้อความด้วยเสียง (สำหรับการแยกระยะเวลา) สำหรับชุดข้อมูล LJSpeech สำหรับชุดข้อมูลอื่น ๆ ตามคำสั่งที่นี่ สำหรับการประมวลผลก่อนการประมวลผลอื่น ๆ คำสั่งต่อไปนี้:
python .nvidia_preprocessing.py -d path_of_wavs -c configs/default.yaml
สำหรับการค้นหาขั้นต่ำและสูงสุดของ F0 และพลังงาน
python .compute_statistics.py
อัปเดตต่อไปนี้ใน hparams.py โดย min และ max ของ F0 และพลังงาน
p_min = Min F0/pitch
p_max = Max F0
e_min = Min energy
e_max = Max energy
python train_lightspeech.py --outdir etc -c configs/default.yaml -n "name"
เช็ด
python .inference.py -c .configsdefault.yaml -p .checkpointsfirst_1xyz.pyt --out output --text "ModuleList can be indexed like a regular Python list but modules it contains are properly registered."
python export_torchscript.py -c configs/default.yaml -n fastspeech_scrip --outdir etc