【Python】AttributeError: module ‘numpy’ has no attribute ‘unit8’ 的解决方法
生活随笔
收集整理的這篇文章主要介紹了
【Python】AttributeError: module ‘numpy’ has no attribute ‘unit8’ 的解决方法
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
經(jīng)排查,下面的一行代碼出了異常:
mask2 = np.where((mask1 == 2) | (mask1 == 0), 0, 1).astype('unit8')異常類型是:
AttributeError: module ‘numpy’ has no attribute ‘unit8’
無(wú)非就是uint8寫成了unit8。
這個(gè)錯(cuò)誤其實(shí)還算挺low的,但也不是不可能出現(xiàn)。
希望別手抖或是慣性思維吧,加油。
總結(jié)
以上是生活随笔為你收集整理的【Python】AttributeError: module ‘numpy’ has no attribute ‘unit8’ 的解决方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【离散数学】二部图
- 下一篇: 【Java】遍历时优雅地删除集合元素