Skip to content
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

No module named 'glow' #337

Closed
jglozma opened this issue Dec 5, 2019 · 9 comments
Closed

No module named 'glow' #337

jglozma opened this issue Dec 5, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@jglozma
Copy link

jglozma commented Dec 5, 2019

I am trying to run example with TRTIS described on https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/Tacotron2/notebooks/trtis

When running step that was supposed to produce ONNX model I have got following error

python export_waveglow_trt.py --waveglow waveglow_256channels_ljs_v3.pt --wn-channels 256 --amp-run
_:::NVLOGv0.2.2 None 1575584732.593067884 (/workspace/tacotron2/dllogger/logger.py:251) args: {"waveglow": "waveglow_256channels_ljs_v3.pt", "output": "waveglow.onnx", "amp_run": true, "sigma_infer": 0.6}
Traceback (most recent call last):
File "export_waveglow_trt.py", line 158, in
main()
File "export_waveglow_trt.py", line 155, in main
export_onnx(parser, args)
File "export_waveglow_trt.py", line 117, in export_onnx
waveglow = load_and_setup_model('WaveGlow', parser, args.waveglow, args.amp_run)
File "/workspace/tacotron2/inference.py", line 122, in load_and_setup_model
state_dict = torch.load(checkpoint)['state_dict']
File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 422, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 609, in load
result = unpickler.load()
ModuleNotFoundError: No module named 'glow'

@jglozma jglozma added the bug Something isn't working label Dec 5, 2019
@jglozma
Copy link
Author

jglozma commented Dec 9, 2019

I found glow.py in https://github.com/NVIDIA/waveglow. Next hurdle to overcome is

root@b5fb39a822ce:/workspace/tacotron2# python export_waveglow_trt.py --waveglow waveglow_256channels.pt --wn-channels 256 --amp-run
:::NVLOGv0.2.2 None 1575856662.273496628 (/workspace/tacotron2/dllogger/logger.py:251) args: {"waveglow": "waveglow_256channels.pt", "output": "waveglow.onnx", "amp_run": true, "sigma_infer": 0.6}
/opt/conda/lib/python3.6/site-packages/torch/serialization.py:489: SourceChangeWarning: source code of class 'glow.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.
warnings.warn(msg, SourceChangeWarning)
/opt/conda/lib/python3.6/site-packages/torch/serialization.py:489: SourceChangeWarning: source code of class 'torch.nn.modules.conv.ConvTranspose1d' 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.
warnings.warn(msg, SourceChangeWarning)
/opt/conda/lib/python3.6/site-packages/torch/serialization.py:489: SourceChangeWarning: source code of class 'glow.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.
warnings.warn(msg, SourceChangeWarning)
/opt/conda/lib/python3.6/site-packages/torch/serialization.py:489: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv1d' 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.
warnings.warn(msg, SourceChangeWarning)
/opt/conda/lib/python3.6/site-packages/torch/serialization.py:489: SourceChangeWarning: source code of class 'glow.Invertible1x1Conv' 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.
warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
File "export_waveglow_trt.py", line 158, in
main()
File "export_waveglow_trt.py", line 155, in main
export_onnx(parser, args)
File "export_waveglow_trt.py", line 117, in export_onnx
waveglow = load_and_setup_model('WaveGlow', parser, args.waveglow, args.amp_run)
File "/workspace/tacotron2/inference.py", line 122, in load_and_setup_model
state_dict = torch.load(checkpoint)['state_dict']
KeyError: 'state_dict'

@ghost ghost self-assigned this Dec 9, 2019
@ghost
Copy link

ghost commented Dec 9, 2019

Hi @jglozma how did you train your checkpoint? Does it come from the https://github.com/NVIDIA/waveglow repository?

@jglozma
Copy link
Author

jglozma commented Dec 9, 2019

Hi,

I have not done any training myself yet. I downloaded two checkpoints from NGC
https://ngc.nvidia.com/catalog/models/nvidia:waveglow_ljs_256channels/files

  • the latest waveglow_256channels_ljs_v3.pt
  • few month ago waveglow_256channels.pt

Both checkpoints produce the same error above

@ghost
Copy link

ghost commented Dec 11, 2019

please download the checkpoint from https://ngc.nvidia.com/models/nvidia:waveglow256pyt_fp16

@jglozma
Copy link
Author

jglozma commented Dec 12, 2019

It worked. Thanks for your help!

@jglozma jglozma closed this as completed Dec 12, 2019
@kb-rahul
Copy link

@grzegorzkarchnv : I am unable to access the model from the link. Has anything changed recently?

@jglozma
Copy link
Author

jglozma commented Dec 17, 2019

it is there. By default, it opens at "Overview". Click on "File Browser" and you will see it

@kb-rahul
Copy link

Thanks

@MuruganR96
Copy link

MuruganR96 commented Nov 21, 2020

please download the checkpoint from https://ngc.nvidia.com/models/nvidia:waveglow256pyt_fp16

@grzegorzkarchnv sir, i have tried it, but unable to download. facing issues. can you please look into this issue.
#754 (comment)
#763 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants