解决:UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version

1.问题

import torch时报错:UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version

2.原因

numpy版本和pytorch所需的numpy版本不匹配

3.解决方案

(1) 卸载现有numpy版本,pip uninstall numpy

(2) 安装匹配的版本,pip install tensorflow,自动补全安装版本匹配的numpy

你可能感兴趣的:(pytorch,tensorflow,计算机视觉,人工智能,深度学习)