Error in size empy

hi
when i am euning in code, i have error
for cnt in range(_batch_size):
tmp_data = dataset_info[data_idx[cnt]]

print(tmp_data)

if len(_image.shape)==3:

_image = cv2.cvtColor(_image, cv2.COLOR_BGR2RGB)

plt.imshow(_image)

plt.pause(0.001)

    _rect = tmp_data['rect']
    _rect0=min(0,_rect[0])
    _rect1=min(0,_rect[1])
    _rect2=min(10,_rect[2])
    _rect3=min(10,_rect[3])
            _image = cv2.imread(tmp_data['img_path'])
    print(tmp_data['img_path'])
    print(tmp_data['rect'])
    if _image is not None:            
        cropped_image = _image[_rect1:(_rect1+_rect3), _rect0:(_rect0+_rect2), :]
        if cropped_image is not None:
            if (len(cropped_image.shape)==3):
                cropped_image = cv2.resize(cropped_image, IMG_SIZE)
                
                _lbp = my_lbp_func(cropped_image)
                _new_image = np.concatenate([(cropped_image/255.0),_lbp],axis=2)
                y_Face[cnt] = 1
            else:
                y_Face[cnt] = 0
        else:
            y_Face[cnt] = 0
    else:
        y_Face[cnt] = 0

File “E:\Final\MyDataLoader.py”, line 161, in load_data_for_net
cropped_image = cv2.resize(cropped_image, IMG_SIZE)

error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4045: error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’

It seems OpenCV is raising this error, as you might have passed an empty numpy array to cv2.resize.
Could you print the shape of cropped_image before passing it to cv2.resize, please?