Question: I cannot figure out why I can't reshape this in python 3. Can someone please help? 303 label2 = np_utils . to_categorical ( label ,

I cannot figure out why I can't reshape this in python 3. Can someone please help?

 303 label2 = np_utils.to_categorical(label, category) --> 304 data_np = data_np.reshape(len(data_np),42,28,1) 305 306 #train,test split ValueError: cannot reshape array of size 141240000 into shape (120000,42,28,1)

I cannot figure out why I can't reshape this in python 3.

In [3]: H ip-model,Xtr.y tr, Xte.y-te- cnn func . CNN mage-recognition(df cat,df-tiger, df lion , df dog, sample-3eeee, binary-False,\ convlayer -64, neuron -1ee, batchsize -128, epoch -20) ValueError ipython-input-3-1062fdfb1e> Traceback (most recent call last) in 1 ip-model , X-tr.y-tr,Xte.y-te- cnn-func . CNN-mage-recognition(df-cat , df-tiger,df-lion,df-dog, sample-3000e, binary-Fal se, convlayer -64, neuron-100, batchsize-128, epoch-20) Desktop\quickdraw-prediction-model-master\python\cnn-func . py in CNN-image-recognition (df1, df2, df3, df4, sample, binary, convlayer, neuron, batchsize, epoch) 97 # runs CNN-model-builder with X and label. returns CNN model and X,Y train and test dataset 98 return CNN_model_builder(X,label,binary-binary, category4,\ cnnp-[convlayer , neuron], fitp-batchsize,epoch]) 100 101 Desktop\quickdraw-prediction-model-master\python\cnn-func . py in CNN model-builder(X, label, binary, category, cnnp, fitp) 302 303 labe12 - np utils.to_categorical(label, category) 305 306 --> 304 data _np data_np.reshape(len data_np),42,28,1) #train,test split ValueError cannot reshape array of size 141240eee into shape (120000,42,28,1) In [3]: H ip-model,Xtr.y tr, Xte.y-te- cnn func . CNN mage-recognition(df cat,df-tiger, df lion , df dog, sample-3eeee, binary-False,\ convlayer -64, neuron -1ee, batchsize -128, epoch -20) ValueError ipython-input-3-1062fdfb1e> Traceback (most recent call last) in 1 ip-model , X-tr.y-tr,Xte.y-te- cnn-func . CNN-mage-recognition(df-cat , df-tiger,df-lion,df-dog, sample-3000e, binary-Fal se, convlayer -64, neuron-100, batchsize-128, epoch-20) Desktop\quickdraw-prediction-model-master\python\cnn-func . py in CNN-image-recognition (df1, df2, df3, df4, sample, binary, convlayer, neuron, batchsize, epoch) 97 # runs CNN-model-builder with X and label. returns CNN model and X,Y train and test dataset 98 return CNN_model_builder(X,label,binary-binary, category4,\ cnnp-[convlayer , neuron], fitp-batchsize,epoch]) 100 101 Desktop\quickdraw-prediction-model-master\python\cnn-func . py in CNN model-builder(X, label, binary, category, cnnp, fitp) 302 303 labe12 - np utils.to_categorical(label, category) 305 306 --> 304 data _np data_np.reshape(len data_np),42,28,1) #train,test split ValueError cannot reshape array of size 141240eee into shape (120000,42,28,1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!