-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
TypeError: forward() got an unexpected keyword argument 'ignore_index' #201
Comments
Hi @DreamerWangDr
We will update tutorial to fix this. |
Thanks, I tried this, still TypeError: forward() got an unexpected keyword argument 'ignore_index'. |
Hi @DreamerWangDr
|
Hi, Thanks. I tried this, TypeError: forward() got an unexpected keyword argument 'ignore_index' disppeard. |
I add a new loss 'my_loss' to mmseg/models/losses/ as the tutorial doc did.
my_loss.py :
`import torch
import torch.nn as nn
from ..builder import LOSSES
from .utils import weighted_loss
@weighted_loss
def my_loss(pred, target):
assert pred.size() == target.size() and target.numel() > 0
loss = torch.abs(pred - target)
return loss
@LOSSES.register_module
class MyLoss(nn.Module):
Then , when I use this loss to train the model, this TypeError appeared.
The text was updated successfully, but these errors were encountered: