出错代码:
点击查看代码
dataset_numpy = x[0].cpu().numpy()
centers = centers.cpu().numpy()
codes = codes.cpu().numpy()
修改后代码:
点击查看代码
dataset_numpy = x[0].cpu().detach().numpy()
centers = centers.cpu().detach().numpy()
codes = codes.cpu().detach().numpy()