Great Resource. As the rookie in the Machine Learning field, this is really practical exercise for the one who wants to integrate ResNet (Not only this, but also other model as he mentions in here) model to the Sequential layers.
Thanks to this video I discovered your amazing channel! Thank you Nachiketa, You are the man! Thanks a lot for all your efforts, trully appreciated from the other side of the world. Please keep this amazing job, God bless you my friend.
Hi, how can I save the model? When I do resnet_model.save('name_model.h5') it gives me an error. I searched information about it but I do not know how to solve It. The error is: Layer ModuleWrapper was created by passing non-serializable argument values in `__init__()`, and therefore the layer must override `get_config()` in order to be serializable. Please implement `get_config()`.
I'm getting an error saying "This model has not yet been built. Build the model first by calling `build()` or calling `fit()` with some data, or specify an `input_shape` argument in the first layer(s) for automatic build." what should I do?
Hey, great video, thank you very much for the explanation and material. I needed to put the loss function to "sparse_categorical_crossentropy" because otherwise it said shape value error.
I'm confused why there is only training and validation. Why is there not also a testing dataset? Isn't validation data used to optimize hyperparameters only? It seems you're using the validation data to evaluate accuracy. Is this normal?
Brother iam very displeased with you. What kind of explanation is that. Who does that. How can your explanation be so easy to understand. Iam displeased coz why didn't I see your videos till this time. But now iam happy that i got someone who explains like others understand. Congrats for a new subscriber.
@@NachiketaHebbar brother, that's a style of talk I adopted if I want someone not just to listen to me but also reply. brother again, thanks for your knowledge sharing .
i'm using the same code and the same dataset as yours but i get this error plz help NameError Traceback (most recent call last) in () 2 history = resnet_model.fit( 3 train_ds, ----> 4 validation_data=val_ds, 5 epochs=epochs) NameError: name 'val_ds' is not defined
It's a name error. You must have done something wrong in naming, maybe capitalised a letter or something while writing val_ds at the two places.. Check on that once
Hi, can you help me with what changes in the above code I should do if I have two classes malicious and non_malicious and a dataset of GRAYSCALE images?
hello my friend. i am planning to use resnet50 for my project. basically the project is about birads classification. i have dataset which has around 3000 images and 3 classes (birads2, birads4, birads5). i want this model to classify the mammography pictures as birads classification. i tried to fine tune this model but it didn't really work. do you have any suggestions or hints for me to tune this model for such a detailed and complicated birads classification?
lets test your knowledge :) 1.is it possible to use transfer learning on VIT(vision transformer model ) ? 2. suppose I trained a mobilenetv2 model , now I want to use this pre-train weights on vgg16 model for transfer learning is it possible to do so .? if not explain why ?
I would like to ask a question. When you split the data into training and validation. Why did you split it into 2 different parts, it makes me think that there's a chance that there are the same images in both training and validation, which makes the result higher than it's should be. Usually, people use the 'split folders' and 'split validation test set' and it's confirmed that there will be no double images that will affect the result of the models.
Hi, thanks for this wonderful video. Can you please explain how can we use some data for test purpose (like you divided dataset into training and validation data) to evaluate the model's performance. Thanks
Hi, i have a question. In the video at 8:25, you said it slightly overfitting. Can you help me what to do to resolve the overfitting problem? I have the same issue like in the video? I'm new to this, hope you help me. Thanks!
A suggestion: There are very less opportunities for Machine learning engineer, data scientist, deep Learning engineer, ai engineer even though it's highly demanded. I highly recommend to focus on opening of such roles in good companies/ startups. Every youtube focusing on software engineering or sde roles openings, please give priority to such roles as well. Also please share interview experience of people who got such roles as a FRESHERS in good companies on campus or off campus. Thank you 😊🙏🏻
my network is starting with 43% accuracy in epoch unlike 70% which is in ur code , any idea why so but model is able to learning and val acuracy is at 40/50 range
please help me ...i have followed the same code but getting error at the fit function... it shows " ValueError: Shapes (None, 3) and (None, 4) are incompatible"
@NachiketaHebbar Hello, I found the error in this line, please do the needful asap. history = resnet_model.fit( train_ds, validation_data=val_ds, epochs=20 ) Error: ValueError: Shapes (None, 1) and (None, 5) are incompatible
It is very important to understand the data you are using before choosing the components of your neural network. The code in the video is correct since it utilizes label_mode="categorical" in conjunction with the categorical cross-entropy loss function. If you intend to use the sparse_categorical_cross_entropy loss function, you must specify label_mode="int". This is especially important because it appears that the data used in the video may not be identical to the data available to us (I did not verify this). The categorical cross-entropy loss function requires one-hot encoding for each class. For example, if there are three classes, A, B, and C, this loss function will work only if the class labels are encoded as [1, 0, 0], [0, 1, 0], and [0, 0, 1], respectively. This encoding is achieved by using the label_mode="categorical" argument. On the other hand, sparse_categorical_cross_entropy does not require such encoding and assigns integers (e.g., 1, 2, 3) to classes A, B, and C. This loss function is preferable when dealing with a large number of classes, such as in predicting words in a vocabulary, as it conserves memory resources A comprehensive introduction to loss functions can be found here: machinelearningmastery.com/how-to-choose-loss-functions-when-training-deep-learning-neural-networks/
Thanks for the great video and explaining everything in detail. I copied your github code, and it was running fine, until this part: resnet_model.add(Dense(5, activation='softmax')) I got an error: ValueError: Shapes (None, 1) and (None, 5) are incompatible. There's a long Traceback for it, but this seemed to be an issue with the output image, so I changed that very last layer to: resnet_model.add(Dense(1, activation='softmax')) Now the training runs, but the accuracy is really bad, around 0.25! Any resolution here? I don't know exactly why the output layer had to be mapped to a (None, 1) shape.
***Do not change your last layer to resnet_model.add(Dense(1, activation='softmax')) your NN needs to recognize between 5 classes(like in this video example). ***Try to use loss='sparse_categorical_crossentropy' in yourmodel.compile() function. That problem appears because your labels are in numbers(0,1,2,3...) not in one hot encoding.
@@tony-iy5xf Thanks, that fixed it, and training epochs reached 1.0000. Why did the code work for you, when you had loss='categorical_crossentropy'? Because I just copied your code from github, and there the loss was set to that method.
Great stuff I just had a doubt if you could help with that When I am trying to reproduce your code I am running into an error in the model.fit() cell of code The error I am getting is "ValueError: Shapes (None, 1) and (None, 5) are incompatible" Can you please help me resolve this
I corrected the below error , The code in blog and in video are different , I corrected code according video and it is working , but one error is getting below code snippet.. can you reslove the error import matplotlib.pyplot as plt plt.figure(figsize=(10, 10)) for images, labels in train_ds.take(1): for i in range(6): ax = plt.subplot(3, 3, i + 1) plt.imshow(images[i].numpy().astype("uint8")) plt.title(class_names[labels[i]]) plt.axis("off")
I fixed it with using "label_mode='categorical'," in he val_ds and trains_ds. Then got error "only integer scalar arrays can be converted to a scalar index" but could be solved by using: plt.figure(figsize=(10, 10)) for images, labels in train_ds.take(1): for i in range(6): ax = plt.subplot(3, 3, i + 1) plt.imshow(images[i].numpy().astype("uint8")) plt.title(class_names[np.argmax(labels[i])]) # Convert tensor to integer plt.axis("off")
I'm trying this code on my custom dataset and I'm getting a lengthy error "ValueError: Shapes (None, 1) and (None, 3) are incompatible" with the mentioned line in the end.
@@AkshayRakate Thanks for your help brother. The Epochs are executing but the images are not Printing it seems now. ERROR: 'only integer scalar arrays can be converted to a scalar index'
in his blog the following block before the plt.figure is missing. class_names = train_ds.class_names print(class_names) It is shown in the video, however.
in this line history = resnet_model.fit(train_ds, validation_data=val_ds, epochs=4) I got error as ----> 1 history = resnet_model.fit(train_ds, validation_data=val_ds, epochs=4) ValueError: Shapes (None, 1) and (None, 5) are incompatible