(-215:Assertion failed) !ssize.empty() in function ‘cv::resize’

I have a problem but I don’t know how to fix this
I have done all the solutions that you all gave
error:
{
“name”: “error”,
“message”: "OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’
",
“stack”: "---------------------------------------------------------------------------
error Traceback (most recent call last)
Cell In[55], line 6
4 train = train.sample(frac = 1)
5 for it in range(int(np.ceil(len(train)/batch_size))):
----> 6 X_train, y_train = get_batch(train, it*batch_size, batch_size)
7 model.train_on_batch(X_train, y_train)
9 model.save("Model")

Cell In[53], line 12, in get_batch(dataframe, start, batch_size)
10 n = idx
11 im, label = get_image_from_number(n,dataframe)
—> 12 im = image_reshape(im, (224,224)) / 255.0
13 image_array.append(im)
14 label_array.append(label)

Cell In[52], line 2, in image_reshape(im, target_size)
1 def image_reshape(im, target_size):
----> 2 return cv2.resize(im, target_size)

error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’
"
}