复现DeepFill V2时,运行train.py文件时报错

问题遇到的现象和发生背景

根据https://github.com/JiahuiYu/generative_inpainting上的顺序进行操作,运行train.py时报错
image is None, sleep this thread for 0.1s.
ERROR:tensorflow:Exception in QueueRunne: OpenCV(4.5.3) /tmp/pip-req-build-s58vuwxh/opencv/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

img

问题相关代码

    def read_img(self, filename):
        img = cv2.imread(filename)
        if img is None:
            print('image is None, sleep this thread for 0.1s.')
            time.sleep(0.1)
            return img, True
        if self.fn_preprocess:
            img = self.fn_preprocess(img)
        return img, False

看了好多解决方法,文件路径没有问题,但还是显示filename为空,所以代码里的filename可以直接改成数据集的路径吗