AttributeError: 'NoneType' object has no attribute 'astype'
stackoverflow.com › questions › 57273464Jul 30, 2019 · AttributeError: 'NoneType' object has no attribute 'astype'. I tried to find the code for the line where the error occurred. File "/sda/ZTL/B/data/util.py", line 79, in read_img def read_img (env, path): # read image by cv2 or from lmdb # return: Numpy float32, HWC, BGR, [0,1] if env is None: # img img = cv2.imread (path, cv2.IMREAD_UNCHANGED) else: img = _read_lmdb_img (env, path) img = img.astype (np.float32) / 255. if img.ndim == 2: img = np.expand_dims (img, axis=2) # some images ...