Sorry for the ignorance, but what is the point to one hot encoding if you’ll transform into a integer in the end? I was making a CNN with the following encoding
def encode(self):
        """ One of the ways to make the encoding """
        df = pd.read_csv('../input/train.csv')
        unique_classes = pd.unique(df['Id'])
        encoding = dict(enumerate(unique_classes))
        encoding = {value: key for key, value in encoding.items()}
        df = df.replace(encoding)
        return df

With this I had no problems. In the end is the same encoding just a list of enumerated numbers from the classes?
target = Variable(torch.FloatTensor(10).uniform_(0, 120).long())