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

RuntimeError: result type Float can't be cast to the desired output type Long #2

Open
turian opened this issue Jul 3, 2020 · 1 comment

Comments

@turian
Copy link

turian commented Jul 3, 2020

Just as a sanity check, I tried running this on a CPU machine. But with both fftnet_config.json and wavenet_config.json it crashes with the following error. This also happens with GPUs on Google Colab

Warning: There's no GPU available on this machine, training will be performed on CPU.
Train Step: [2/10000 (0%)] Loss: 5.568979
Traceback (most recent call last):
  File "train.py", line 71, in <module>
    main(config, args.resume)
  File "train.py", line 44, in main
    trainer.train()
  File "/Users/personal/dev/wavenet-like-vocoder/trainer/trainer.py", line 47, in train
    self.writer.add_image('input', make_grid(data.cpu(), nrow=8, normalize=True))
  File "/usr/local/lib/python3.7/site-packages/torchvision/utils.py", line 67, in make_grid
    norm_range(tensor, range)
  File "/usr/local/lib/python3.7/site-packages/torchvision/utils.py", line 61, in norm_range
    norm_ip(t, float(t.min()), float(t.max()))
  File "/usr/local/lib/python3.7/site-packages/torchvision/utils.py", line 55, in norm_ip
    img.add_(-min).div_(max - min + 1e-5)
RuntimeError: result type Float can't be cast to the desired output type Long
@yoyolicoris
Copy link
Owner

@turian thanks for your report.
Seems there has been some changes in newer version torchvision.
Please change data.cpu() to condition.cpu() in the following line, should fix the problem.
https://github.com/yoyololicon/wavenet-like-vocoder/blob/3591786b6507173323b7b657a98b9bdffabbee46/trainer/trainer.py#L47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants