我嘗試了warnings.catch_warnings()和輸入?yún)?shù)都未能捕獲轉(zhuǎn)換警告force_copyimport numpy as npimport skimageimport warningsmm = np.ones([55,55],dtype=np.float32)with warnings.catch_warnings(): dd = skimage.img_as_uint(mm,force_copy=True)給XXX/lib/python2.7/site-packages/skimage/util/dtype.py:130: UserWarning: Possible precision losswhen converting from float32 to uint16.format(dtypeobj_in, dtypeobj_out))
捕獲函數(shù)skimage.img_as_uint中的警告
慕田峪7331174
2022-08-02 17:27:07