Cannot determine Numba type of <class 'numba.core.dispatcher.LiftedLoop'
解决ok。
代码:
@jit()
def initial_background(I_gray, N):
# symmetric:对称填充
I_pad = np.pad(I_gray, 1, 'symmetric')
height = I_pad.shape[0]
width = I_pad.shape[1]
samples = np.zeros((height, width, N))
for i in range(1, height - 1):
for j in range(1, width - 1):
for n in range(N):
x, y = 0, 0
while (x == 0 and y == 0):
x = np.random.randint(-1, 1)
y = np.random.randint(-1, 1)
ri = i + x
rj = j + y
samples[i, j, n] = I_pad[ri, rj]
samples = samples[1:height - 1, 1:width - 1]
return samples
报错:
Compilation is falling back to object mode WITH looplifting
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/jacke121/article/details/121681643
内容来源于网络,如有侵权,请联系作者删除!