Comments (2)
`def process_text(train_text_path):
hparams = hp_tacotron2.create_hparams()
hparams.sampling_rate = hp.sample_rate
checkpoint_path = os.path.join("Tacotron2", os.path.join(
"pre_trained_model", "tacotron2_statedict.pt"))
tacotron2 = train_tacotron2.load_model(hparams)
state_dict = torch.load(checkpoint_path)['state_dict']
tacotron2.load_state_dict(state_dict)
_ = tacotron2.cuda().eval().half()
with open(train_text_path, "r", encoding="utf-8") as f:
inx = 0
txt = []
for line in f.readlines():
cnt = 0
l = line.strip().split("|")
cid = l[0]
n = int(cid.replace(".npy", "").split("-")[-1])
text_seq = l[-1]
sequence = np.array(text_to_sequence(text_seq, hp.text_cleaners))[None, :]
sequence = torch.autograd.Variable(
torch.from_numpy(sequence)).cuda().long()
mel, mel_postnet, _, alignment = tacotron2.inference(sequence)
alignment = alignment.float().data.cpu().numpy()[0]
alignment = get_D(alignment)
np.save("alignment_targets/%s.npy" %n, alignment)
return txt`
this is my alignment, but i don't know if it is right @xcmyz
from fastspeech.
Thanks. I'll try it
from fastspeech.
Related Issues (20)
- Is this still maintained?
- training stops in few seconds and no checkpoint file created HOT 3
- error in new commit HOT 9
- How to get alignment? HOT 8
- Preprocess.py got stuck: Tried to debug
- Have anyone tried using LSTM to replace FFT block?
- What is the difference between postnet and CBHG? HOT 3
- 请问训练多久得到的pretrain model呢?然后,请问使用了多少GPU呢? HOT 1
- Resume training from checkpoint result in NaN? HOT 1
- How to extract alignment from tacotron2? HOT 6
- long int 转换成float erro
- denoiser HOT 1
- some question about squeezewave denoiser
- onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from fastwave.onnx failed:Type Error: Type parameter (T) bound to different types (tensor(double) and tensor(float) in node ().
- Expected object of backend CUDA but got backend CPU for argument #3 'index' HOT 1
- duration loss calulated in log domain or linear domain
- wav in chinese HOT 1
- Error when training new model for another language
- BUG:OSError: sndfile library not found HOT 1
- RuntimeError: stack expects each tensor to be equal size, but got [40, 240] at entry 0 and [78, 202] at entry 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastspeech.