Convolutional Neural Networks – Deep Learning basics with Python, TensorFlow and Keras p.3




[ad_1]

Welcome to a tutorial where we’ll be discussing Convolutional Neural Networks (Convnets and CNNs), using one to classify dogs and cats with the dataset we built in the previous tutorial.

Text tutorials and sample code: https://pythonprogramming.net/convolutional-neural-network-deep-learning-python-tensorflow-keras/

Discord: https://discord.gg/sentdex
Support the content: https://pythonprogramming.net/support-donate/
Twitter: https://twitter.com/sentdex
Facebook: https://www.facebook.com/pythonprogramming.net/
Twitch: https://www.twitch.tv/sentdex
G+: https://plus.google.com/+sentdex

Source


[ad_2]

Comment List

  • sentdex
    November 13, 2020

    I like your enthusiastic explanations and fun videos

  • sentdex
    November 13, 2020

    send me the data set please.

    francisowino824@gmail.com

  • sentdex
    November 13, 2020

    I got an error. Please can someone help me to solve it.

  • sentdex
    November 13, 2020

    how to test the model with a new image ?

  • sentdex
    November 13, 2020

    FileNotFoundError: [Errno 2] No such file or directory: 'X.pickle' how to solve this issue.

  • sentdex
    November 13, 2020

    HAving lot dof
    <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>]
    when I fit the model. What the reason?

  • sentdex
    November 13, 2020

    Hey sendex, may I ask what kind net structure are you using? CNN has a lot of net structure, like vgg-16, u-net, and etc. Therefore, what's the net structure you are using?

  • sentdex
    November 13, 2020

    thank you for such good videos!!!

  • sentdex
    November 13, 2020

    Do we need shuffle= True in the model.fit as like below?
    history=model.fit(X_train, y_train, batch_size=32, epochs=10, validation_split=0.25, shuffle=True)

  • sentdex
    November 13, 2020

    What are you doing when you import pickle?

  • sentdex
    November 13, 2020

    Hey guys, I am getting an error like this please help

    ValueError: Input 0 of layer sequential is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: [None, 200, 200]

    This same error is occurring in my other project too, the input_shape synatx is correct (img_size, img_size, 1).

    This is my code:

    model = Sequential()

    model.add(Conv2D(64, (3,3), input_shape = (img_size, img_size, 1)))

    model.add(Activation("relu"))

    model.add(MaxPooling2D(pool_size = (2, 2)))

    model.add(Conv2D(64, (3, 3)))

    model.add(Activation("relu"))

    model.add(MaxPooling2D(pool_size = (2, 2)))

    model.add(Flatten())

    model.add(Dense(64))

    model.add(Dense(1))

    model.add(Activation("sigmoid"))

    model.compile(loss = "binary_crossentropy", optimizer = "adam", metrics = ["accuracy"] )

    model.fit(X, y, batch_size = 32, epochs = 3, validation_split = 0.1)

  • sentdex
    November 13, 2020

    I have datasets of disease leaf ….I want to train a model …..how should I proceed sir please help me out

  • sentdex
    November 13, 2020

    This is such a great intro to the subject. I am interested in creating my own data for which I would train a network instead of downloading something rom the internet—-aka, recording a video of something for which I can extract alot of image frame from (at least 30 frames per second) and use these images as training/test data. I plan to reshape images and the like before feeding to a CNN–but do you have any pointers on pitfalls I might face when creating my own data sets (other than the fact I would need a lot of training data)? Thanks again for these tutorials, you make this subject incredibly fun.

  • sentdex
    November 13, 2020

    if anyone wants to know how to test it on a new image. first have it save your model to a file then i used a seperate python script to and did this:
    Image_size = (your image size)

    CatDogModel = tf.keras.models.load_model('put the name of your model save file here')

    ImagePath = "(Path to your image)"

    Image = cv2.imread(ImagePath, cv2.IMREAD_GRAYSCALE)

    NewImage = cv2.resize(Image, (Image_size, Image_size))

    NewImage = np.array(NewImage).reshape(-1, Image_size, Image_size, 1)

    prediction = CatDogModel.predict([NewImage])

    a = prediction[0]

    print(a)

    0 is dog and 1 is cat.

    I dont know if I did it in the best way but that's what I did and it works.

  • sentdex
    November 13, 2020

    his mugs are impressive

  • sentdex
    November 13, 2020

    Where have we passed the dataset for training? Anyone plz?

  • sentdex
    November 13, 2020

    Bro Thank you so much for this tutorial. This helped me in doing my academic project. Thank you so much bro.

  • sentdex
    November 13, 2020

    From where did the program pick all the images ?

  • sentdex
    November 13, 2020

    Can anyone help
    When I fit my data and apply epochs,its only applying on 29 why not my whole data
    Its showing
    1 epoch 0/29
    Why so and how to solve it
    Please anyone help

  • sentdex
    November 13, 2020

    Can i run in D:

  • sentdex
    November 13, 2020

    this will sound weird asf but I had a dream about this guy (no homo). I haven't seen his videos in several months and had this dream I randomly met him and became friends with him, then was like O wait you're that guy from Youtube lmao. weirdest dream. Anyway I took it as a sign that I should circle back to his videos for some reason

  • sentdex
    November 13, 2020

    Why do we put an activation function in the output layer? Should the sigmoid be applied in the hidden layer Dense(64) before the last layer? I thought the activation is only required for multi-classification output. (using SoftMax)

  • sentdex
    November 13, 2020

    I got 80% of accuracy, but i have a problem,, everytime i tryin' to input my own image, the result is always inverted.. When i input a picture of cat, i got 1, when i input the picture of dog, i got 0,, in my datasets, my 'dog' files have index of 0 and cat 1, any idea?

  • sentdex
    November 13, 2020

    Why my ML only run 702 samples, and not 24946??

  • sentdex
    November 13, 2020

    FileNotFoundError Traceback (most recent call last)

    <ipython-input-15-161f4f2178da> in <module>()

    4 import pickle

    5

    —-> 6 X= pickle.load(open("X.pickle","rb"))

    7 y= pickle.load(open("y.pickle","rb"))

    8

    FileNotFoundError: [Errno 2] No such file or directory: 'X.pickle' What is this error ? please help

  • sentdex
    November 13, 2020

    Can you do a convNet on reading tree rings? I want to make an app that can do that !

  • sentdex
    November 13, 2020

    what's X.pickle , y.pickle? i have error on them

  • sentdex
    November 13, 2020

    I feel like I'm in your classroom.

  • sentdex
    November 13, 2020

    unfortunately youtube does not allow to put likes as many as you want

  • sentdex
    November 13, 2020

    try looking at missinglink.ai

  • sentdex
    November 13, 2020

    the cup you use in the video is cute, where can I find one

  • sentdex
    November 13, 2020

    I am only able to get an accuracy of 52% although I did the same steps as in the video. Can somebody help?

  • sentdex
    November 13, 2020

    Can anybody explain me, when our epochs start we see like epoch 1/10 and under that 22424/22424 how are we getting this number 22424 and also is it going to be different or same for all
    I'm quite confused can anyone guide me here.

  • sentdex
    November 13, 2020

    InvalidArgumentError: indices[24946] = 24946 is not in [0, 24946) [Op:GatherV2]
    help me with this

  • sentdex
    November 13, 2020

    Hi, I have an error of "cannot import name 'Keras' on google colab. Any idea how I can solve this?Thanks. I'm using tensorflow2.0

  • sentdex
    November 13, 2020

    love ya!

  • sentdex
    November 13, 2020

    how to input image to a cnn and then compare it with our dataset

  • sentdex
    November 13, 2020

    What happens, if you try to classify a cow for example? Is it possible to say that’s not a dog and that’s not a cat, but anything else?

  • sentdex
    November 13, 2020

    hey I am getting the accuracy of .15 , can you please help me how can i improve it , I am using more than 2 things to classify

  • sentdex
    November 13, 2020

    what changes can be done to make it able to train datasets that uses 3 categories?

  • sentdex
    November 13, 2020

    Mantap videonya.
    Saya juga ada nih rekomendasi channel lain buat belajar neural network siapa tau cocok hehe.

    https://youtu.be/vyAsO_fzNF8

  • sentdex
    November 13, 2020

    for some reason the dimension from the previous vid didn't work for me till I modified the code to:
    X = np.array(X).reshape(-1, IMG_SIZE, IMG_SIZE, 1)

  • sentdex
    November 13, 2020

    Hi, I have a problem like that , when I start code from this material

    "ValueError Traceback (most recent call last)

    <ipython-input-1-7729ec2f54ec> in <module>

    37 metrics=['accuracy'])

    38

    —> 39 model.fit(X, y, batch_size=32, epochs=3, validation_split=0.3)

    "

    And I don't have idea , what is the case of problem ? Is someone who has that problem and have a sollution ?

  • sentdex
    November 13, 2020

    Why are we reshaping the data in 2D array?

  • sentdex
    November 13, 2020

    The way you're training the model is very different from the way we trained numerical datasets 😒

  • sentdex
    November 13, 2020

    Use of max_pooling(2,2)?

  • sentdex
    November 13, 2020

    When I run my Script, it only outputs out of 702. When there is like 24,000 images

  • sentdex
    November 13, 2020

    How do I do one hot encoding if I want to use his model for multiclass classification?

Write a comment