Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Hypatia68 opened this issue Nov 28, 2019 · 3 comments

Comments

@Hypatia68
Copy link

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
Copy link

same with me

@shyamsulbhewar7
Copy link

I am also facing same error

@dregula
Copy link

dregula commented Sep 6, 2020

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants