執行Augmentation 出現ValueError: Got dtype 'float64', which is a forbidden dtype (uint32, uint64, uint128, uint256, int32, int64, int128, int256, float64, float96, float128, float256).
2019/12/19 下午 03:34
電腦視覺深度學習討論版
王思之
觀看數:104
回答數:2
收藏數:0
cvdl-1
cvdl-1-d16
回答列表
-
2019/12/19 下午 03:44楊哲寧贊同數:0不贊同數:0留言數:0
您好,可能是版本不同,關於部分Augmentation的支援的type有了變動,由於有些Augmentation對float64的影像不支援,所以會報錯,有時才會報錯是因為我們是隨機啟動Augmentation的。可以嘗試改變input_type:
img = cv2.imread('Tano.JPG',)
img = cv2.resize(img, (224,224))##改變圖片尺寸
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #Cv2讀進來是BGR,轉成RGB
多這一行:
img=img.astype(np.uint8)
-
2023/07/31 下午 05:44王柏鈞贊同數:0不贊同數:0留言數:0
imgaug這個套件在color相關的影像增強中,只支援np.uint8。另外除了color相關之外的其他影像增強方法也不一定有支援float64,請查以下網址確認。 https://imgaug.readthedocs.io/en/latest/source/dtype_support.html