Houdines从一个完整的图像中插入了一些有用的数据。这个方法运行得很好,只是现在我遇到了一些内存问题。在predict()步骤中,我已经缩小了kriging算法中的内存问题。我试图使用batch_size参数来限制内存消耗,但这很麻烦。我得到了这个错误:
Traceback (most recent call last):
File "e:\mapInterpolation.py", line 88, in <module>
prepareImage(file, interpType="kriging")
File "e:\mapInterpolation.py", line 61, in prepareImage
rInterpInt = kriging(r).astype(int)
File "e:\mapInterpolation.py", line 36, in kriging
interpolated = gp.predict(rr_cc_as_cols, batch_size=a).reshape(data.shape)
File "e:\miniconda\lib\site-packages\sklearn\gaussian_process\gaussian_process
.py", line 522, in predict
for k in range(max(1, n_eval / batch_size)):
TypeError: 'float' object cannot be interpreted as an integer
我已经三次检查了传递给batch_size参数的类型,它是一个int,而不是一个float。我真的需要这个工作,这样我可以得到一个输出,用于我的硕士学位的最后一个项目,这将在几周内到期。我包括下面的代码。另外,如果有人对如何使径向计算更有效地存储有任何建议,我非常开放。在
^{pr2}$
这看起来像是python3中scikitlearn中的一个bug—除法here在python3中产生了一个float,
range
然后就正确地停止了。在有一个corresponding issue here,但它似乎是一个}无论如何都是不推荐使用的
wontfix
,理由是{相关问题 更多 >
编程相关推荐