+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

2020-03(49)

2020-04(67)

2020-05(28)

2020-06(46)

2020-07(42)

line 117, in linspace num = operator.index(num)TypeError: 'numpy.float64' object cannot be interp

发布于2020-04-22 16:16     阅读(1175)     评论(0)     点赞(7)     收藏(5)


0

1

2

3

4

记录一下错误和解决方案

C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\Scripts\python.exe E:/work/facode/0finger/app/enhance/image_enhance.py
Traceback (most recent call last):
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\numpy\core\function_base.py", line 117, in linspace
    num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:/work/facode/0finger/app/enhance/image_enhance.py", line 68, in <module>
    img = image_enhance(img)
  File "E:/work/facode/0finger/app/enhance/image_enhance.py", line 32, in image_enhance
    newim = ridge_filter(normim, orientim, freq, kx, ky)  # create gabor filter and do the actual filtering
  File "E:\work\facode\0finger\app\enhance\ridge_filter.py", line 59, in ridge_filter
    x, y = np.meshgrid(np.linspace(-sze, sze, (2 * sze + 1)), np.linspace(-sze, sze, (2 * sze + 1)))
  File "<__array_function__ internals>", line 6, in linspace
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\numpy\core\function_base.py", line 121, in linspace
    .format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

Process finished with exit code 1
找了很多网上的改正方法,没有找到导致错误的代码 看到网上说更换

原因是numpy1.18.2版本与其他软件的兼容性的问题导致。
解决办法:将numpy1.18.2的版本降为1.17,测试可以正常运行。其他可行办法尚未测试。
结果如下:

原文链接:https://blog.csdn.net/sereasuesue/article/details/105652854

0

1

2

3

4



所属网站分类: 技术文章 > 博客

作者:天青色等烟雨

链接: https://www.pythonheidong.com/blog/article/337335/aa78cdc6283de894dfd1/

来源: python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

7 0
收藏该文
已收藏

评论内容:(最多支持255个字符)