Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions

Question

LO2 Explain the major laws governing employee compensation.

Answered: 1 week ago