“ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions.”
I’m running a python file “data_prep.py” in which it prepares and load image data for use in a machine learning model, particularly for classification tasks involving images of different categories. However, Ive been getting an error everytime I tried to return the value in prep_and_load_data():
“ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions.”
I’m running a python file “data_prep.py” in which it prepares and load image data for use in a machine learning model, particularly for classification tasks involving images of different categories. However, Ive been getting an error everytime I tried to return the value in prep_and_load_data():
Why does the program insist something is a sequence when it is not?
I wrote a function which returns me a certain array. Whenever I just print a certain value of this function, it works fine. However, if I try to remember certain values of the function as variables, it works for one variable, but afterwards it returns me an error, saying: “ValueError: setting an array element with a sequence.”