numpy升级以后遇到以上错误,版本变化函数名称发生变化:根据错误提示点击到arrycrop.py文件
加入下面语句
修改前:
import numpy as np
from numpy.lib.arraypad import _validate_lengths
修改后:
import numpy as np
from distutils.version import LooseVersion as Version
old_numpy = Version(np.__version__) < Version('1.16')
if old_numpy:
from numpy.lib.arraypad import _validate_lengths
else:
from numpy.lib.arraypad import _as_pairs