DeepRNN / image_captioning

Tensorflow implementation of "Show, Attend and Tell: Neural Image Caption Generation with Visual Attention"
MIT License
785 stars 354 forks source link

SystemError: <built-in function imread> returned NULL without setting an error #66

Open Hypatia68 opened 4 years ago

Hypatia68 commented 4 years ago

Training the model... epoch: 0%| | 0/100 [00:00<?, ?it/s] batch: 0%| | 0/11290 [00:00<?, ?it/s] epoch: 0%| | 0/100 [00:00<?, ?it/s] Traceback (most recent call last): File "D:/Img Cpaiton/image_captioning-master/main.py", line 70, in tf.compat.v1.app.run() File "D:\Python37\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "D:\Python37\lib\site-packages\absl\app.py", line 299, in run _run_main(main, args) File "D:\Python37\lib\site-packages\absl\app.py", line 250, in _run_main sys.exit(main(argv)) File "D:/Img Cpaiton/image_captioning-master/main.py", line 50, in main model.train(sess, data) File "D:\Img Cpaiton\image_captioning-master\base_model.py", line 47, in train images = self.image_loader.load_images(image_files) File "D:\Img Cpaiton\image_captioning-master\utils\misc.py", line 36, in load_images images.append(self.load_image(image_files)) File "D:\Img Cpaiton\image_captioning-master\utils\misc.py", line 17, in load_image image = cv2.imread(image_file) SystemError: returned NULL without setting an error

shivam-S-bisht commented 4 years ago

same with me

shyamsulbhewar7 commented 4 years ago

I am also facing same error

dregula commented 4 years ago

I had the same issue using a List of files generated by the pathlib module: List_of_matching_Files = Path(parent_directory_path).glob(pattern_to_match_in_filename) (This may also occur other glob() functions.) The List_of_matching_Files is a List is of some sort of custom Type, that looks like a string, but really isn't. The following correctly maps each filename to a string, then you can use the string with imread, imwrite, etc. List_of_matching_Files = list(map(str,List_of_matching_Files)