'Getting error 'NoneType' object has no attribute 'read' in python for image processing image_dataframe['image']

I am working on image classification using CNN.

sample data frame

I am using below source code for that task. I am stuck with this error : AttributeError: 'NoneType' object has no attribute 'read' Could you please anyone guide me to solve this issue? in path volume, the values are none please anyone can help me how I can mention the path of images In this Code

image_dataframe.isnull().sum()
image_dataframe['age'].fillna((image_dataframe['age'].mean()), inplace=True)
image_dataframe.isnull().sum()
#Image Preprocessing
image_dataframe['image'] = image_dataframe['path'].map(lambda x: np.asarray(Image.open(x).resize((100,75))))

And, I've got this error:

error

Also, I am getting errors in this line:

second error



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source