6、RuntimeError: “log_softmax_lastdim_kernel_impl“ not implemented for ‘Long‘

问题: 在训练模型,计算损失函数的时候,报如下错误: 解决方法: 1、查看预测值和标签的数据类型,使用dtype方法; 2、将预测值的数据类型改为torch.f

问题:

        在训练模型,计算损失函数的时候,报如下错误:

解决方法:

        1、查看预测值和标签的数据类型,使用dtype方法;

        2、将预测值的数据类型改为torch.float32;