RuntimeError: “topk_cpu“not implemented for ‘Half‘

问题:torch.topk (cpu)不支持半精度(FP16)计算

RuntimeError: “topk_cpu“not implemented for ‘Half‘_第1张图片

解决:model对象用“float()”进行转换后再操作

你可能感兴趣的:(pytorch,python,剪枝)