Jun-12-2020, 10:10 AM
(Jun-12-2020, 09:01 AM)DreamingInsanity Wrote: What it looks like you are trying to do is 'open' a directory to get all the images, so you can use them elsewhere.
I would recommend the glob module for that.
import glob def open_train_data(): return glob.glob('/home/mojito/Desktop/CNN/datasets/training_data/images/*') #the '*' is a 'wildcard' and it means to match one or more characters for f in open_train_data(): dict1 = pickle.load(f) ###do whatever else you need to
I ran the code you posted. I got this error:
Using TensorFlow backend. Traceback (most recent call last): File "source_code_modified.py", line 78, in <module> dict1 = pickle.load(f) TypeError: file must have 'read' and 'readline' attributesIt explodes at this point:
dict1 = pickle.load(f)