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

Dev #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Dev #1

wants to merge 3 commits into from

Conversation

VincentLa
Copy link

@VincentLa VincentLa commented Jun 24, 2020

No description provided.

target[target == 100] = 1 # building interior
target[target == 255] = 2 # border
target[target == 99] = 0 # Self Added by Vincent (Not sure what 99 is?)
target[target == 256] = 0 # Self Added by Vincent (Not sure what 99 is?)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure about this. If I didn't do this, I get an error:

Traceback (most recent call last):
  File "training/train_aml.py", line 321, in <module>
    main()
  File "training/train_aml.py", line 292, in main
    step = train(loader_train, model, criterion, optimizer, epoch, step, logger_train)
  File "training/train_aml.py", line 166, in train
    loss = criterion(scores, y)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/loss.py", line 932, in forward
    ignore_index=self.ignore_index, reduction=self.reduction)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py", line 2317, in cross_entropy
    return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py", line 2117, in nll_loss
    ret = torch._C._nn.nll_loss2d(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
IndexError: Target 99 is out of bounds.

I think it has something to do with annotations, but I'm not sure how to know what 100 vs 255 vs 99 vs 256 means?

Like in the original code, how did the author know that target == 100 corresponded to building interior?

@VincentLa VincentLa force-pushed the dev branch 2 times, most recently from 6c747ce to e97e91d Compare June 24, 2020 21:47
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

Successfully merging this pull request may close these issues.

1 participant