I have created a dataset mapping images to their labels for a ml project. I want to save the dataset on a script and load it in another one to save time every time I rerun the code for the model.
The output from the dataset gives me a list of tuples containing an ImagingCore object and 2 string type objects.
The output of print(dataset)
is
[(<ImagingCore object at 0x12091a825>, 'R', 'FIRST'),(<ImagingCore object at 0x12091a850>, 'L', 'THIRD'),...]
Where the second element of each tuple is either left or right, and the third goes from first to fourth.
I have tried to save the dataset with pickle, json, dill, hickle, using the structure
with open('data.pickle', 'wb') as f:
pickle.dump(dataset, f)
but I always get the same error:
TypeError: cannot pickle 'ImagingCore' object
Can someone help? This has been literally driving me crazy for weeks