Had to sign in to say thank you. Breaking down each line is incredibly useful. I also love how you continually point out that there's areas for improvement and reference us to what may be classified as overkill. It gives an excellent gateway into machine learning by linking this seemingly simple explanation to actually recognised CNNs and FC layers etc.!
Hi guys. Just want to help anyone following this later like I was. Instead of using tensorflow (if you aren't seeing tf.keras.datasets which is what had me stuck), you can get the mnist variable from : from keras.api.datasets import mnist. Also if you import keras.api as k_api (or whatever name i suck at naming), replace all the tf.keras with k_api. It should work the same.
Why did we choose to use 128 neurons for our first Dense layer? I have always wondered what is the intuition that should be used for the number of neurons needed for a layer? Is it kinda just random
great tutorial. how can i increase the accuracy. shoudl I just screw up the epochs. I tried this, but some digits like a angeled one or a 5 that get "recognized" as a 6 or a 3(as example). sorry for my bad english :D
I got this error. Changing the extension of the model to keras solved it. File "C:\Users\user\anaconda3\envs\main\Lib\site-packages\keras\src\saving\saving_api.py", line 106, in save_model raise ValueError( ValueError: Invalid filepath extension for saving. Please add either a `.keras` extension for the native Keras format (recommended) or a `.h5` extension. Use `model.export(filepath)` if you want to export a SavedModel for use with TFLite/TFServing/etc. Received: filepath=handwritten.model.
I followed this tutorial and it runs with similar loss and accuracy results to the video. My problem is when I make my own written numbers, the accuracy is usually less than 50%. I have tried playing around with the number of hidden layers, numbers of neurons, and number of epochs and I don't see any real change. What other likely places I could look to find a fix.
Try replacing all of the model.add lines with this 😉 model.add(tf.keras.layers.Conv2D(32, (3,3), activation='sigmoid', input_shape=(28, 28, 1))) # The one in "(28, 28, 1)" is required or else it'll error out model.add(tf.keras.layers.MaxPool2D((2, 2))) model.add(tf.keras.layers.Conv2D(48, (3,3), activation='sigmoid')) model.add(tf.keras.layers.MaxPool2D((2, 2))) model.add(tf.keras.layers.Dropout(0.5)) model.add(tf.keras.layers.Flatten()) model.add(tf.keras.layers.Dense(500, activation='sigmoid')) model.add(tf.keras.layers.Dense(10, activation='sigmoid'))
Hi F, very useful video as always! when you can, could you make a video about voice recognition/transcription in Python like youtube autosubtitle. To eliminate background noises ... what would you do? Thx
Why did you normalise the train and test data separately. Shouldn’t we first normalise train data and then apply the same normalisation factor to test data?
@@BasedArmenian-kh8pb yes but we turned the black on white paint images to white on black. So I was expecting it to work. The owner of the channel used black on white too
I followed the video to the word, frame by frame. I got this "Mistake" before saving the model (before applying to self made numbers). The loss is 2.3, and the accuracy is 0.097. During the training though, all accuracies are over 90. Can anyone tell me what is the problem? Is there anything wrong with the test set? This is a great video. I just want to make it work !!
I'm very new to this and have a small doubt when training the data we normalized the pixel values to be between 0 and 1, but when we are predicting using jpgs we dont normalize it, why is that?
I think the reason he normalized the pixel values to be between 0 and 1 is because as he said their values range between 0 and 255. Since this is a big range of numbers normalizing the pixel data would be most ideal as it would reduce the impact of spread on our model. However, when predicting the jpgs they only take on a value between 0 - 9 so label data cannot necessarily be as spread out as the pixel data can be, rendering it kinda useless to do so. Again this is just my thought process. If some of my logic is incorrect, please don't hesitate to correct me internet.
Amazing tutorial man, i'm a complete beginner and this is totally understandable and it's so awesome, i only have a question, what do i do if i want to use larger images, is it possible?
it seems my created model keeps giving wrong output so i increased epochs but same issue, i noticed it looks at a specific pattern and it finds it similar to another it checks to two numbers as the same number. For example, the 3 and 8 gets confused and it gets termed as 3 all the time. i wonder if it needs more training or do i need to change the code somewhere...
Hi sir , if we give the image in which we give any paragraph so they can detect it or not ,for example in image we give A ,so the they detect it or not
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. this is the error i had
This is not an error but a statement u can ignore, but if there is no output that probably mean program was not able to get the digits directory so check your path is correct or not, for me it was to include the directory name where the digits directory was stored
this might be a stupid question but it isn't obvious for me in the code. How is the output layer ordered? what I mean is how does index 0 directly map to value '0', index 1 to '1', etc. I also searched this up for letter recognition and they have 0-25 mapping in order to letters sequentially. maybe someone can explain
I think the reason he normalized the pixel values to be between 0 and 1 is because as he said their values range between 0 and 255. Since this is a big range of numbers normalizing the pixel data would be most ideal as it would reduce the impact of spread on our model. However, when predicting the jpgs they only take on a value between 0 - 9 so label data cannot necessarily be as spread out as the pixel data can be, rendering it kinda useless to do so.
Hi buddy, thank you for your useful videos. However, I am getting this error "NameError: name "keras" is not defined when I try to classify the datasets into training and test datasets. How can I solve this error, please?
im not fully sure about this but you can try changing the numbers in the "model.add(tf.keras.layers.Flatten(input_shape = (28,28)))" so change it to be like "model.add(tf.keras.layers.Flatten(input_shape = (32,32)))"
In line #8 you are loading data, but you dont specify any files. I dont see were you are creating the actual training data and testing data. All I see is at the end , you creating data to actually use the model. where is the training data?
Hi. Can someone help me to find my mistake. Where i can save the folder of image so that my programs will read directly to that folder. bcoz, it does not read the image number when i run the programs. really appreciate to someone help and enlighten me. tnx.
It is really helpful and all. Thank you. For me, there could be more illustration of what happens to our data after what command line. Often you just guess it, but you can not be sure, especially when you are not using standard python methods, as you just see the output. Like with neural networks itself. :)
I'm at 14:04 and I'm getting the following error after loading the saved model 'logits and labels must have the same first dimension, got logits shape [32,10] and labels shape [25088]'. Is anyone getting the same error, I've researched it and it apparently has something to do with the loss function being sparse_categorical_crossentropy or categorical_crossentropy?
I found the problem and fixed it. I wrote 'test_y = tf.keras.utils.normalize(test_X, axis=1) ' instead of 'test_X = tf.keras.utils.normalize(test_X, axis=1) '
unbeliavable, no one before me not comment is this only works for 28,28. really unbeliavable. do you really understand what he mentioned ? I think you do not.
errors come up for every piece of code you write. I am unsure what wizardry you're doing to get it to work on your end. it always fails on mine and it pisses me off.
he doesnt really understand neural networks too, just using tensorflow, there are far better videos on the subject, just look around , these "programmer" youtubers really are the bad side of the platform, they gain massive viewers and they are junior at best.