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

Problem in Loss Func. Use ICDAR2015 to train to model, but this problem emerged. #9

Open
leonrenlang opened this issue Dec 24, 2019 · 2 comments

Comments

@leonrenlang
Copy link

File "/workspace/PixelLink-with-pytorch/main.py", line 144, in
main()
File "/workspace/PixelLink-with-pytorch/main.py", line 133, in main
train(config.epoch, iteration, dataloader, my_net, optimizer, optimizer2, device)
File "/workspace/PixelLink-with-pytorch/main.py", line 73, in train
pixel_pos_weights)
File "/workspace/PixelLink-with-pytorch/criterion.py", line 46, in pixel_loss
self.neg_pixel_weight[i] = self.neg_pixel_weight[i] & (neg_pixel_masks[i]==1)
RuntimeError: Expected object of scalar type Byte but got scalar type Bool for argument #2 'other' in call to _th_and

@ligaoyuan-potato
Copy link

你好,请问你训练成功了吗?

@Mageayo
Copy link

Mageayo commented Aug 10, 2021

change
self.neg_pixel_weight[i] = self.neg_pixel_weight[i] & (neg_pixel_masks[i]==1)
to
self.neg_pixel_weight[i] = self.neg_pixel_weight[i] & (neg_pixel_masks[i]==1).byte()

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

3 participants