RuntimeError: Can‘t call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

RuntimeError: Can’t call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.在这里插入图片描述

应使用tensor.detach().numpy()将Tensor数据转为numpy数据

你可能感兴趣的:(numpy,python,机器学习,bug,深度学习)