inference.ipynb: changing waverglow inference fo fp16

experiments
rafaelvalle 2018-12-05 22:14:35 -08:00
parent 6e430556bd
commit 4d7b04120a
1 changed files with 7 additions and 12 deletions

View File

@ -23,10 +23,7 @@
{ {
"name": "stderr", "name": "stderr",
"output_type": "stream", "output_type": "stream",
"text": [ "text": []
"/home/dcg-adlr-rafaelvalle-source.cosmos597/repos/nvidia/tacotron2/plotting_utils.py:2: UserWarning: matplotlib.pyplot as already been imported, this call will have no effect.\n",
" matplotlib.use(\"Agg\")\n"
]
} }
], ],
"source": [ "source": [
@ -113,17 +110,15 @@
{ {
"name": "stderr", "name": "stderr",
"output_type": "stream", "output_type": "stream",
"text": [ "text": []
"/opt/conda/lib/python3.6/site-packages/torch/serialization.py:425: SourceChangeWarning: source code of class 'glow_old.WaveGlow' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
" warnings.warn(msg, SourceChangeWarning)\n",
"/opt/conda/lib/python3.6/site-packages/torch/serialization.py:425: SourceChangeWarning: source code of class 'glow_old.WN' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.\n",
" warnings.warn(msg, SourceChangeWarning)\n"
]
} }
], ],
"source": [ "source": [
"waveglow_path = 'waveglow_old.pt'\n", "waveglow_path = 'waveglow_old.pt'\n",
"waveglow = torch.load(waveglow_path)['model']" "waveglow = torch.load(waveglow_path)['model']\n",
"waveglow.cuda().half()\n",
"for k in waveglow.convinv:\n",
" k.float()"
] ]
}, },
{ {
@ -210,7 +205,7 @@
], ],
"source": [ "source": [
"with torch.no_grad():\n", "with torch.no_grad():\n",
" audio = waveglow.infer(mel_outputs_postnet, sigma=0.666)\n", " audio = waveglow.infer(mel_outputs_postnet.half(), sigma=0.666)\n",
"ipd.Audio(audio[0].data.cpu().numpy(), rate=hparams.sampling_rate)" "ipd.Audio(audio[0].data.cpu().numpy(), rate=hparams.sampling_rate)"
] ]
} }