Closed NomiMalik0207 closed 4 years ago
@NomiMalik0207 Could you tell me which line of our code raises that error?
while testing i got an error on line target = torch.nn.functional.one_hot(target, num_classes=input.size(-1)) Attribute error that one_hot is not module in torch.nn.functional, i am using python 3.5 with latest verision of pytorch
@NomiMalik0207
There's no target = torch.nn.functional.one_hot(target, num_classes=input.size(-1))
in our repository.
I guess you are probably confused with other implementation.
yes, actually i also want to use soft verision of cross entroy loss
@NomiMalik0207
Again, we didn't use one_hot
function to get mixed cross-entropy loss. We aggregate two loss values with weight values as in https://github.com/clovaai/CutMix-PyTorch/blob/master/train.py#L246.
Your problem is not related to our implementation and seems to be related to pytorch version.
thank you ... have solved it. using your rapo
I am trying this code but got error about AttributeError: module 'torch.nn.functional' has no attribute 'one_hot' but i have latest verision of pytorch