question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Training Phase] cannot reshape array of size 107100 into shape (89,100,1)

See original GitHub issue

While trying to play around with the .ipynb, I get the following error

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-a59e65dd974e> in <module>
     17     image = cv2.imread('Dataset/FistTest/fist_' + str(i) + '.png')
     18     gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
---> 19     testImages.append(gray_image.reshape(89, 100, 1))
     20 
     21 testLabels = []

ValueError: cannot reshape array of size 107100 into shape (89,100,1)

The only thing that I’m doing, just to play around, is to modify the network’s structure to this

convnet=input_data(shape=[None,89,100,1],name='input')
convnet=conv_2d(convnet,32,2,activation='relu')
convnet=max_pool_2d(convnet,2)
convnet=conv_2d(convnet,64,2,activation='relu')
convnet=max_pool_2d(convnet,2)

#convnet=conv_2d(convnet,128,2,activation='relu')
#convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,256,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,256,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,128,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=conv_2d(convnet,64,2,activation='relu')
convnet=max_pool_2d(convnet,2)

convnet=fully_connected(convnet,1000,activation='relu')
convnet=dropout(convnet,0.75)

convnet=fully_connected(convnet,3,activation='softmax')

convnet=regression(convnet,optimizer='adam',learning_rate=0.001,loss='categorical_crossentropy',name='regression')

model=tflearn.DNN(convnet,tensorboard_verbose=0)

But the crashing point is called before the network’s inizialization so I can’t get, honestly, what’s going wrong 😕

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
aminhoneycommented, Feb 2, 2020

Solution of Value Error: I got according to my system i make changes into the prediction = model.predict([gray_image.reshape(75,100,1)]). here just prediction = model.predict([gray_image.reshape(89,100,1)]) >>>>>89 change with 75 after made this change I finally solve that ERROR.

0reactions
SparshaSahacommented, Feb 4, 2020

@aminhoney Please raise a Pull Request with the fix… I will merge the code into master

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot reshape array of size into shape - Stack Overflow
I am getting this error: ValueError: cannot reshape array of size 9992 into shape (1,28,28). How do I fix this? In the tutorial...
Read more >
Cannot reshape array of size 12288 into shape (64,64)
If you have a third dimension, say RGB images, with three layers of 64×64, you wind up with the desired number of pixels....
Read more >
ValueError: cannot reshape array of size 0 into shape ...
I encounter this error when I import and refine a particle subset of a large extraction. I recall someone posted that this could...
Read more >
ValueError: cannot reshape array of size - Image.sc Forum
After 200 000 iterations of training I'm trying to evaluate the network by GUI but got this error: ValueError Traceback (most recent call ......
Read more >
“ValueError: cannot reshape array of size 278540 into shape ...
I have trained a YOLO v3 Object Detection Model. To incorporate into my flutter application I am trying to convert it to .tflite, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found