Tutorial 27- Create CNN Model and Optimize using Keras Tuner- Deep Learning
Вставка
- Опубліковано 21 гру 2019
- Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more
/ @krishnaik06
Keras Tuner blog: keras-team.github.io/keras-tu...
Google Colab Code Link: colab.research.google.com/dri...
Please do subscribe my other channel too
/ @krishnaikhindi
Connect with me here:
Twitter: / krishnaik06
facebook: / krishnaik06
Instagram: / krishnaik06
Out of 309 videos 285 videos you created in 2019 itself. great work man! Keep going.
Machine
@@damianwysokinski3285 it’s human
@@masthanjinostra2981 machine
@@damianwysokinski3285 okay
Thanks for this video. Yesterday only I saw your video 26. You said you will be completing the code explaintion in the next video. I am waiting for the second part of video -26 to come.😁
Great explaination like always sir! Thankyou!
Pooling layer should be given after convolutional layer. Its a must to reduce the computation and it also effects the accuracy, so you have to also use it in keras tuner as well. The results you got from keras tuner wont be the same, when you will actually be bulding the final model with pooling layer
Bro🔥🔥 You saved my time. I was thinking this from last day that how can i choose parameters for my cnn model .. in this Computer world how can someone leave things to do manually by Programmer .... See Its KerasTuner here ❤️.. thanks Bhaiya You are awesome i always check you videos. 🔥🔥
Thanks for the great effort, I wish if you enhance the audio quality so I can follow the tutorial without struggling to catch the steps
even videos on 6/2020 have low audio quality.
And thanks again Krish for the valuable tutorials.
It is an amazing add-on while building models.
Thanks for these video sir. Please also continue the ml deployment series
Very helpful tutorial, thanks a lot
Thank you for the video :) I have a small doubt, umm, the accuracy was increasing, but the validation loss (val_loss) at the end during training was also increasing, does not that mean , the model is over fitting?
Thank you! Amazing help!
Thank you. This was awesome
hii Krish... thanks for such an amazing tutorial but i have a doubt why you haven't used pooling and data augmentation for more accurate prediction?
Thank you for the great video. How can I also tune the optimizers (let's say ['Adam, RMSprop]) with dynamic learning rates? Many tutorials keep it fixed. Thank you
thank you so much for really helped
Great video! I have a question, it seems you already chose 2 conv2d layers, and you only searched for filters, kernel size, dense layers and learning rate. Can we also search for how many conv2d layers, pooling, dropout, etc.?
Yes, you can loop over the number of layers, check the sub-topic "The search space may contain conditional hyperparameters" in this link --> "keras-team.github.io/keras-tuner/"
@@pranav.shetty hey, in the tutorial, 99% accuracy is on training data, how to check accuracy on test data.
ohh my god its very amazing really
Thank you sir for this video.. Please upload video for the explanation of CNN for text classification.
Sir, how can we use keras tuner alongside transfer learning?
What's new in keras-tuner ? Earlier also it was possible by using scikit wrapper class for the keras model and then perforrming gridsearch or random_search for finding the best parameters.
Kerastuner gives you flexibility to tune the number of layers as well. Apart from randomsearch there are tuners in keras which can use bayesian approach to narrow down the parameter search space.
Thanks Krish
thanks alot sir
hi, i wanted to ask can we use pretrained models for facial emotion classification problem?
make a video for creating our own dataset and classification......which wil be very helpful
hello sir ! can we apply this method for CNNS that deal with Image Classification as well? by images I mean set of JPg images which are directly used as Input Training data?
I am getting beow error while executing this code. Please help me to figure this out.
Objective value missing in metrics reported to the Oracle, expected: ['val_accuracy'], found: dict_keys(['loss', 'acc', 'val_loss', 'val_acc'])
Great video: How can I force Keras Tuner to use default hyperparameter values for the first optimization iteration
sir, can we use CNN rather then images datasets like software defect prediction dataset of NASA repository
Hi, very good explanation. but i found that the model is overfitted as the percentage of training loss and validation loss is more. kindly explain
Sir can you plz tell how to reshape train set & test set if the datasets are RGB images becoz that reshape thing is not working even after giving reshape(len(img_train),50,50,3).Here 50x50 is my pixel size
can you plz make a video on Adam optimizer as you have made for gradient descent, coz we r unable to understand how this adam works
A tip : watch series on instaflixxer. Been using them for watching all kinds of movies lately.
@Jermaine Reece yea, have been watching on InstaFlixxer for years myself :)
thank you sir
Hi Krish! Do you have a video explaining how one can use the Keras tuner with a pre-trained model? I am currently working on a drug classification project using MobileNet. I am not able to go above a test accuracy of 85%. Also, when I try to predict an image that is input by the user, the prediction is incorrect a lot of the times. Hence, I was wondering if I can use the keras tuner to fine tune the MobileNet to get a better accuracy. Is it possible?
Great video , Why did you skip the Max pooling layer ?
Sir in kernal do we have predefined dataset for face detection like fashion_mnist dataset ?
Keras and Tensorflow: two tools with some of the highest numbers of installation issues that you can get.
Hi,so i build a model for 1 dim cnn regression problem using keras and i did the preprocessing and reshape the data and so on, the thing is the loss for train and valid very big about number with 9 digits for both of them and the model shows accurcy equal to 1 from the first epoch .so what can i do to solve it i tried to use keras tunner but there is no difference ,any help please
Hey Krish, didn't find the code in the description (as you mentioned in the video tutorial).
Sir kindly guide me, can we use this code to perform binary classification on text dataset?
Hi Krish - when i tried to follow you and gave -
tuner_search=RandomSearch(build_model,objective='val_accuracy',max_trials=5,directory='output',project_name="Mnist Fashion")
so seems for me it is giving error like -
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/kerastuner/engine/hypermodel.py", line 104, in build
model = self.hypermodel.build(hp)
File "", line 7, in build_model
input_shape=(28,28,1)
TypeError: __init__() missing 1 required positional argument: 'filters'
is there any changes
Great tutorial, Can you update the code where "no. of epoch, choice of optimizers, batch size " as a hyperparameter for keras tuner. Thanks in advance.
Dear sir i am confusing how i will give input image and how get output.
please can you tell me? ...what happen if we decrease number of filters in CNN like 64 ,32 ,16? because generally we increase number of filters in cnn
how do you use maxpooling in it?
at the last line of code when you used model = tuner_search.get_best_models(numb_models=1)[0]
and got the best params with epoch = 3 , how can you use these params and then use it to test your model , and you didnt mention in the video how to test the model.
I HAVE QUESTION ON TEST ACCURACY OF FIGSHARE DATASET of brain tumor classification. My model train accuracy and validation accuracy is above 90 but for test sample the accuracy is not so good. It is showing lot of miss classification . Data augmentation has been done but no improvement
run time error to many failed attempts to build model if anyone knows, please answer
Sir please make video using keras tuner for cat dog classifier
hello, can you show thsi using custom jpgs image folder and data (e.g ./Train (./cat ../dog ../panda ) ) & Test (.simlar)
Why reshaping is required?
after model gets trained, there is no test? lines of code missing at end in Colab Code?
In line 11 I get error..tuner_search =RandomSearch(build_model,objective='val_accuracy' max_trails) in this line..error flatten is not defined..please help me
Sir what is mobile net and vgn architecture ??
Sir, why are we adding dense layers after adding the Convolution layers? You didn't explain this in the lectures..
the final dense layer is to classify the object
how to predict the hyperparameters for own dataset
i am facing an error "INFO:tensorflow:Oracle triggered exit" after running tuner_search.search. Pls help how to resolve this error.
Is this technique works for video data set or 3D CNN?
InvalidArgumentError: Incompatible shapes: [32,1] vs. [32,22,22] error is shown at line tuner_search.search(train_images,train_labels,epochs=3, validation_split = 0.1)
Hi krish
how to reslove this error
TypeError: __init__() missing 1 required positional argument: 'kernel_size'
in googlecolab
Can we use this for CNN pretrained models ?
Sir, how to adjust the parameters of CNN... like no. of convolution layer.. Pooling layer... Fully connected layer
the validation accuracy is less than training accuracy ......so it is clearly overfitting ...any suggestions for that ????
great video :)
if u found the answer could you please post it mam
It's normal that val acc. < train acc. But if you want to improve it try Dropout, Bagging, Early Stopping, Regularization etc.. (techniques to reduce variance of the model)
hi, can we use pretrained models for image classification problem?
yeah dude
Hi sir
It's really amazing video..
Can u perform CNN on own data like cats/dogs in google colab like how to read our data to perform simple CNN classification model.Can u pls...
Yes, there is a video on this channel only which shows the step by step procedure of loading the data for cnn in google colab
while training in your system it is showing out of 54000 but in mine, it is showing 1688! Why?
I came across a term called pilot code. Can you tell me what is a AI pilot code?
what is step size in hp.Int()?? How does it affect?
sir just one question how to decide the output nodes in dense layer..you have taken 10 but how to decide that...or how you came with 10..please answer sir
The output node is equal to the number of classes present in dataset.
sir will you please upload video about GANs
What about the pooling layer??
Hi can you do the project aqi prediction based on image based deep learning algorithm
Can anyone tell me is there any function for maintaining imbalance data in tensorflow?
Awsome Library , But How To Use It For Dropout layer?
It's showing me the error build_model not defined??
Please explain the reshaping part, I didn't get that
Reshape input images to following - [batch size , height, width, channel]. For greyscale images channel=1
aren't filter and kernal same ? if same, why we are giving two separate names conv_1_filter and conv_1_kernal ?
Filter means no. Of filters
And kernel means size of filter
can anyone tell me how to save this final output?
@krish I'm getting RuntimeEroor:-Too many failed attempts to build model and TypeError: __init__() missing 1 required positional argument: 'fiters"
its filters check code again...
How to use keras-tuner in functional api model ??
can you create several env in colab?
Sir pls make a project video of RNN using karas
how to predict images based on labels
How to check the accuracy on test data ? here it's multi class data.
Great video but no value if we do not practice.Thanks
why didnt you use pooling here?
Hi sir can you please make a video on what is the right mindset a person should have before he starts building something with deep learning. I was a Django developer till now following your videos to enter in this domain. thank you sir
Sir, when I run this code in Colab,
tuner_search = RandomSearch(build_model,
objective='val_accuracy',
max_trials=5, executions_per_trial=3, directory='output', project_name="Mnist Fashion")
I have got this error given below:
RuntimeError: Too many failed attempts to build model.
Can anyone help how to solve it??
Did you get any solution to this!?
I love your videos, and I realized something, your epochs are running damn fast.. So I looked at my code, and copied the same model.. 4 minutes on a Titan.. mmm ..After hours of searching for the cause, I discovered it was coming from the ImageDataGenerator that is slow as hell !
If I don't use a flow from dataframe.. hard to get an epoch of more than 30s. If I put a simple shear, or any transformation in an ImageDatagenerator: 4minutes !
But then how can I do transfer learning, like VGG16 that has a preprocess function (so my epochs are of 4minutes !) If I remove the preprocess ? few secs per epoch
Plzz show how to run flask on Google colab
i followed the exact sane steps, but my output is 0.09
How to solve this error?
ValueError: attempt to get argmin of an empty sequence
what is that "step=16" in each conv2d??
i also have the same doubt
@@aarohibychithrasona4004 It is the step size, means 32,(32+16=48),(48+16=64)....upto 128 (max)
Why did we reshape the image arrays at 9:26 ??
It needs to be (nxnx1) that's y it's how cnn takes input
waiting for adam optimizer video
Sir please make a simple cnn video without using any tuners, its confusing
what is flatten layer?
From 24:48 I think it just flattens the multi-dimension input into single dimension
sir can you kindly upload the code of this tutorial?. it was so interesting
check in description, everything is there bro
The validation loss 0.5 and the training loss is about 0.02, which means the model is performing very on the training data but it performs horribly on the validation data. So indirectly the training accuracy won't matter even if it is greater than 95%, the model will be predicting wrong. Requires a lot of hyperparameter tuning. But I won't complain coz u only ran for 5 epochs.
Why don't you teach in pytorch sir???
you should have used early stopping, obviously your model is overfitting