计算交叉熵时报错:
RuntimeError: multi-target not supported at /pytorch/aten/src/THCUNN/generic/ClassNLLCriterion.cu:15
维度不匹配导致
input, target的维度与F.cross_entropy()函数要求的维度不匹配
解决方法:
F.cross_entropy( input, target.squeeze() )
计算交叉熵时报错:
RuntimeError: multi-target not supported at /pytorch/aten/src/THCUNN/generic/ClassNLLCriterion.cu:15
维度不匹配导致
input, target的维度与F.cross_entropy()函数要求的维度不匹配
解决方法:
F.cross_entropy( input, target.squeeze() )