How to fix AttributeError: module 'numpy' has no attribute 'square'

How to fix AttributeError: module 'numpy' has no attribute 'square'

我已经将 numpy 更新到 1.14.0。我使用 Windows 10。我尝试 运行 我的代码,但出现此错误:

AttributeError: module 'numpy' has no attribute 'square'

这是我的导入:

%matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
import math

我删除了 numpy.py 然后更新了我的 numpy,它成功了!