PixelLink-with-pytorch icon indicating copy to clipboard operation
PixelLink-with-pytorch copied to clipboard

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

Open leonrenlang opened this issue 5 years ago • 2 comments

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

leonrenlang avatar Dec 24 '19 03:12 leonrenlang

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

ligaoyuan-potato avatar Aug 25 '20 05:08 ligaoyuan-potato

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()

Mageayo avatar Aug 10 '21 07:08 Mageayo