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

Error training the generator with IAM #17

Closed
AlxJude opened this issue Jul 11, 2021 · 2 comments
Closed

Error training the generator with IAM #17

AlxJude opened this issue Jul 11, 2021 · 2 comments

Comments

@AlxJude
Copy link

AlxJude commented Jul 11, 2021

Hello again,

While training the generator with IAM daaset, I am getting the following error.

Begin training
Traceback (most recent call last):
  File "train.py", line 134, in <module>
    main(config, args.resume)
  File "train.py", line 79, in main
    trainer.train()
  File "/handwriting_line_generation/base/base_trainer.py", line 219, in train
    result = self._train_iteration(self.iteration)
  File "/handwriting_line_generation/trainer/hw_with_style_trainer.py", line 367, in _train_iteration
    losses = self.run_gen(instance,lesson)
  File "/handwriting_line_generation/trainer/hw_with_style_trainer.py", line 1069, in run_gen
    recon,style = self.model.autoencode(image,label,mask,a_batch_size,center_line=center_line,stop_grad_extractor=autoSGStyle)
  File "/handwriting_line_generation/model/hw_with_style.py", line 729, in autoencode
    style = self.extract_style(image,label,a_batch_size)
  File "/handwriting_line_generation/model/hw_with_style.py", line 781, in extract_style
    style = self.style_extractor(collapsed_image, collapsed_label)
  File "/anaconda3/envs/DocumentAnalysis/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/handwriting_line_generation/model/char_style.py", line 122, in forward
    x = self.down(x)
  File "/anaconda3/envs/DocumentAnalysis/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/anaconda3/envs/DocumentAnalysis/lib/python3.8/site-packages/torch/nn/modules/container.py", line 139, in forward
    input = module(input)
  File "/anaconda3/envs/DocumentAnalysis/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/handwriting_line_generation/model/MUNIT_networks.py", line 1124, in forward
    x = self.conv(self.pad(x))
  File "/anaconda3/envs/DocumentAnalysis/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/anaconda3/envs/DocumentAnalysis/lib/python3.8/site-packages/torch/nn/modules/padding.py", line 275, in forward
    return F.pad(input, self.padding, 'replicate')
  File "/anaconda3/envs/DocumentAnalysis/lib/python3.8/site-packages/torch/nn/functional.py", line 4172, in _pad
    return torch._C._nn.replication_pad2d(input, pad)
RuntimeError: "replication_pad2d_cuda" not implemented for 'Long'

Before this error I got the first error in #11 , which I solved as per the suggestion in the post.

Kindly help me with this error.
Thank you for your help.

@herobd
Copy link
Owner

herobd commented Jul 13, 2021

I was relying on a default tensor type in the dataset collate. I just fixed this, so pull the latest.

@AlxJude
Copy link
Author

AlxJude commented Jul 21, 2021

It is working smoothly now. Thanks!

@herobd herobd closed this as completed Jul 21, 2021
@AlxJude AlxJude mentioned this issue Jul 22, 2021
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