I don’t know, which line of code raises this particular error message, but nn.CrossEntropyLoss expects class indices as the target, while you seem to use soft targets.
You could use this implementation 6 for label smoothing.