我的错误代码及解决方案
报错信息:
File
“D:\programs\Anaconda3\lib\site-packages\hyperopt\pyll\stochastic.py”, line 100, in randint
return rng.integers(low, high, size)
AttributeError: ‘numpy.random.mtrand.RandomState’ object has no attribute ‘integers’
报错版本:
python version:3.8
hyperopt version:0.2.7
numpy version: 1.21.5
报错原因:
版本不匹配
解决方案:
安装0.2.5版本的hyperopt
pip uninstall hyperopt
pip install hyperopt==0.2.5
其他解决方案
来自:
贝叶斯调参报错:Object has no attribute ‘integers‘
解决方案:
将代码 rstate=RandomState(seed)
改成rstate=np.random.default_rng(seed)