Toma0916 / GlobalWheatDetection

3 stars 0 forks source link

effdet,image_size=256にすると動かない? #87

Closed kminoda closed 4 years ago

kminoda commented 4 years ago

80

Traceback (most recent call last):
  File "train.py", line 222, in <module>
    train_epoch()
  File "train.py", line 82, in train_epoch
    loss_dict = model(images, targets)
  File "/home/toma/kaggle/GlobalWheatDetection/model.py", line 149, in __call__
    loss, _, _ = self.model(images, boxes, labels)
  File "/home/toma/anaconda3/envs/gwd/lib/python3.8/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/toma/kaggle/GlobalWheatDetection/utils/effdet/bench.py", line 105, in forward
    return self.loss_fn(class_out_origin, box_out_origin, cls_targets, box_targets, num_positives)
  File "/home/toma/anaconda3/envs/gwd/lib/python3.8/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/toma/kaggle/GlobalWheatDetection/utils/effdet/loss.py", line 183, in forward
    cls_loss = _classification_loss(
  File "/home/toma/kaggle/GlobalWheatDetection/utils/effdet/loss.py", line 102, in _classification_loss
    classification_loss = focal_loss(cls_outputs, cls_targets, alpha, gamma, normalizer)
  File "/home/toma/kaggle/GlobalWheatDetection/utils/effdet/loss.py", line 29, in focal_loss
    cross_entropy = F.binary_cross_entropy_with_logits(logits, targets.to(logits.dtype), reduction='none')
  File "/home/toma/anaconda3/envs/gwd/lib/python3.8/site-packages/torch/nn/functional.py", line 2433, in binary_cross_entropy_with_logits
    raise ValueError("Target size ({}) must be the same as input size ({})".format(target.size(), input.size()))
ValueError: Target size (torch.Size([1, 32, 32, 9])) must be the same as input size (torch.Size([1, 64, 64, 9]))
kminoda commented 4 years ago

優先順位は低いかな