Untitled

 avatar
unknown
plain_text
6 months ago
1.3 kB
2
Indexable
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[86], line 6
      3 X_train, X_temp, y_train, y_temp = train_test_split(X,y,test_size=0.3,random_state=None, shuffle=True)
      4 X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, test_size=0.5,random_state=None, shuffle=True)
----> 6 X_train = np.array([x.reshape(x.shape[0], x.shape[1], 1) for x in X_train])
      7 X_val = np.array([x.reshape(x.shape[0], x.shape[1], 1) for x in X_val])
      8 X_test = np.array([x.reshape(x.shape[0], x.shape[1], 1) for x in X_test])

Cell In[86], line 6, in <listcomp>(.0)
      3 X_train, X_temp, y_train, y_temp = train_test_split(X,y,test_size=0.3,random_state=None, shuffle=True)
      4 X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, test_size=0.5,random_state=None, shuffle=True)
----> 6 X_train = np.array([x.reshape(x.shape[0], x.shape[1], 1) for x in X_train])
      7 X_val = np.array([x.reshape(x.shape[0], x.shape[1], 1) for x in X_val])
      8 X_test = np.array([x.reshape(x.shape[0], x.shape[1], 1) for x in X_test])

ValueError: cannot reshape array of size 150528 into shape (224,224,1) 
Editor is loading...
Leave a Comment