RuntimeError: expected scalar type Long but found Float. - test

Maybe this old question can help you. It seems you have a similar problem, due to CrossEntropyLoss