GPU bench-marking with image classification | Deep Learning Tutorial 17 (Tensorflow2.0, Python)

Поділитися
Вставка
  • Опубліковано 19 чер 2024
  • This video shows performance comparison of using a CPU vs NVIDIA TITAN RTX GPU for deep learning. We are using 60000 small images for classification. These images can be classified in one of the 10 categories below,
    classes = ["airplane","automobile","bird","cat","deer","dog","frog","horse","ship","truck"]
    Here is the dataset link: www.cs.toronto.edu/~kriz/cifa...
    We will use simple artificial neural network (we are not using CNN, usually CNN is preferred for image classification but since we have not covered that in our deep learning playlist so far we will be happy with simple ANN that still gives pretty high accuracy).
    #gpuperformance #gpuperformancetest #GPUbenchmarking #imageclassification #DeepLearningTutorial #deeplearning
    Code link: github.com/codebasics/deep-le...
    Exercise: github.com/codebasics/deep-le...
    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.
    CUDA,cuDNN installation instructions: shawnhymel.com/1961/how-to-in...
    Next video: • Customer churn predict...
    Previous video: • Tensorboard Introducti...
    Deep learning playlist: • Deep Learning With Ten...
    Machine learning playlist : ua-cam.com/users/playlist?list...
    Prerequisites for this series:
    1: Python tutorials (first 16 videos): ua-cam.com/users/playlist?list...
    2: Pandas tutorials(first 8 videos): • Pandas Tutorial (Data ...
    3: Machine learning playlist (first 16 videos): ua-cam.com/users/playlist?list...
    Website: codebasics.io/
    Facebook: / codebasicshub
    Twitter: / codebasicshub

КОМЕНТАРІ • 106

  • @codebasics
    @codebasics  2 роки тому +2

    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.

  • @yashwanthbkumar1755
    @yashwanthbkumar1755 3 роки тому +3

    You are doing a tremendous job. Thanks for the video

  • @GrammarExplorers
    @GrammarExplorers 8 місяців тому

    Nice presentations and teaching. Thank you.

  • @KenJee_ds
    @KenJee_ds 3 роки тому +6

    Awesome stuff!

  • @pritishpattnaik4674
    @pritishpattnaik4674 2 роки тому +1

    Thanks sir for ur tremendeous efforts , I am blessed for finding ur channel

  • @kumarsubhambili3
    @kumarsubhambili3 Рік тому +6

    I have Macbook Air M1 and I was surprised to know that for a single epoch run on 50000 image training datasets, The difference time between CPU and GPU was just 6 secs. While for 10 epochs, GPU time consumption was 3 min 19 secs and CPU time consumption was 4 min 19 secs

  • @abiRahimSheikh
    @abiRahimSheikh 2 роки тому

    The article solved my problem, of including GPU device.

  • @shreyasb.s3819
    @shreyasb.s3819 3 роки тому +1

    Amazing...superb content. Nice explained

  • @rishavbhattacharjee7182
    @rishavbhattacharjee7182 3 роки тому +5

    Sir loving the deep learning series...Please don't discontinue this series.

    • @codebasics
      @codebasics  3 роки тому +4

      i am continuing it and you will see more videos coming in

    • @rishavbhattacharjee7182
      @rishavbhattacharjee7182 3 роки тому +2

      @@codebasics Thanks sir. Sir I have an Intel GPU and everyone says CUDA wouldn't be compatible with anything other than Nvidia GPUs. What should I do sir? What GPU toolkit should I install?

    • @lakshsinghania
      @lakshsinghania Місяць тому

      @@rishavbhattacharjee7182 what did u do then ? did u get any solution for it

    • @rishavbhattacharjee7182
      @rishavbhattacharjee7182 Місяць тому

      @@lakshsinghania Had to get an NVIDIA GPU. Thats the only solution I found

    • @lakshsinghania
      @lakshsinghania Місяць тому

      @@rishavbhattacharjee7182 f 🥲😭😭

  • @rohangupta7060
    @rohangupta7060 2 роки тому

    You are amazing your video is so simple and easy to understand, really gone through every video and that is better by better every day i learn.
    i never got bored nothing hat's off to youuuuuuuu😀😀 And yes LOVE from NEPAL

    • @codebasics
      @codebasics  2 роки тому

      Rohan thanks for your kind words of appreciation :)

  • @priyabratapanda1216
    @priyabratapanda1216 3 роки тому +12

    Really Amazing 😍😍😍. Although I don't have GPU but somehow I managed to do by kaggle kernel.🙏🙏💓

    • @lakshsinghania
      @lakshsinghania Місяць тому

      could u pls brief on kaggle kernel? does it provide some gpu memory/space ? for running deep learning programs

  • @dataguy7013
    @dataguy7013 2 роки тому

    Gifted Trainer, thank you for the videos

  • @chathurangiatugoda3859
    @chathurangiatugoda3859 2 роки тому

    Thank you very much my dear sir. I could able to sort out my problem.

  • @jongcheulkim7284
    @jongcheulkim7284 2 роки тому

    Thank you very much.

  • @spicytuna08
    @spicytuna08 2 роки тому

    thank you so much.

  • @hemamaliniveeranarayanan9901
    @hemamaliniveeranarayanan9901 2 роки тому

    Awesome video sir. Can you please put videos on data hiding and detecting with code.

  • @techsavy5669
    @techsavy5669 2 роки тому +1

    Amazing video. I tried the scenario on my integrated nvidia quadro m1000m, the difference wasn't much (~ 25 seconds better). I guess we need a dedicated/external card!
    But, I too obtained a lower evaluate accuracy of 0.5539. That means the model is biased/overfitting! How can we optimize it !? Any pointers. Thank you.

    • @devloper_hs
      @devloper_hs 2 роки тому +1

      You can try with CNN also, else you can go for hyper parameter tuning and early stopping to stop over training

  • @haritaharish478
    @haritaharish478 3 роки тому

    Hi sir, can u suggest on opting btwn AWS and Salesforce as a career.......

  • @atifhussain9351
    @atifhussain9351 3 роки тому

    Nice

  • @EarlWallaceNYC
    @EarlWallaceNYC 2 роки тому

    very informative

  • @MasterCoder99
    @MasterCoder99 3 роки тому +5

    Sir can you make a C++ Tutorial? I would learn faster with your teaching style.
    Thanks

    • @codebasics
      @codebasics  3 роки тому +9

      Sure. I will add to my Todo list. My Todo list is growing very fast 😊

  • @pravallikaa3306
    @pravallikaa3306 Рік тому

    Hello , great tutorial , thanks. When should we one hot encode the values ? Is there any rule reg this?

    • @raghuvamsiyaram7248
      @raghuvamsiyaram7248 Рік тому

      When we have categorical variables in dataset, use one hot encoding.

  • @sanooosai
    @sanooosai 5 місяців тому

    great

  • @dilipkumar2k6
    @dilipkumar2k6 2 роки тому

    I do all ML programming on Kaggle only, do I need to try on my local as well?

  • @mdshamsuzzamanroni370
    @mdshamsuzzamanroni370 3 роки тому +1

    Sir, I want to know will there be any PyTorch video classification tutorial?

    • @dec13666
      @dec13666 3 роки тому

      In the 6th video in this series, he said he'll focus on Keras over Tensorflow, since that's the goal of this series. Up to this day, being 41 videos in this series so far, he hasn't mentioned anything else regarding PyTorch.

  • @adityahpatel
    @adityahpatel 3 роки тому

    All my personal laptops are macbooks and work laptop is macbook too. How do i get CUDA for MacOS to be able to try this out?

  • @vikramreddy5631
    @vikramreddy5631 3 роки тому +2

    Please make a video how to install Nvidia drivers and cuda ...

  • @deepakavva317
    @deepakavva317 3 роки тому

    How to decide number of hidden layers and number of nodes? Are there any parameters or we can just keep random number?

    • @codebasics
      @codebasics  3 роки тому

      Read this insightful answer (first one). There are general guidelines but no fixed rules. For hidden layer you would keep number of neurons as inbetween neurons in input layer and output layer. There on you can tweak it using trial and error: stats.stackexchange.com/questions/181/how-to-choose-the-number-of-hidden-layers-and-nodes-in-a-feedforward-neural-netw

  • @minTwin
    @minTwin 3 роки тому

    Could you make a video on how to add your own custom datasets?

    • @dec13666
      @dec13666 3 роки тому

      It depends on what kind of data you'll load. What is it? Images, Databases, Excel spreadsheet... That way it'll be faster for others to help you out.

  • @vishaltanawade7637
    @vishaltanawade7637 2 роки тому

    Please make video on how to install all necessary software/Library to use gpu for deep learning in jupyter notebook

  • @owenpatrickfalculan3327
    @owenpatrickfalculan3327 3 роки тому

    sir why did you one hot encoded the labels? or I can also use the same discrete labels and use sparse categorical crossentropy?

  • @AjayKumar-id7mb
    @AjayKumar-id7mb 3 роки тому +1

    Hey if you are not having GPU you can use google colab GPU.

  • @AlonAvramson
    @AlonAvramson 2 роки тому

    Thank you! Could you compile this test without flattening the input or categorizing the y?

  • @shadmanmartinpiyal4057
    @shadmanmartinpiyal4057 11 днів тому

    I used kaggle's GPU,
    if compared with CPU computation time against GPU,
    the difference is wayyyyy significant.

  • @user-jl4wk5ms4f
    @user-jl4wk5ms4f 3 роки тому

    how to run GPU in details? I installed Nvidia cuda but I don't know which cuDNN is suitable there are runtime and developer liberary

  • @jrajpal5
    @jrajpal5 Рік тому

    Hello sir
    Thank you so much for the video
    But i am facing an error while testing with gpu
    Failed copying input tensor from ....CPU/0 to ....GPU/0 in prder to run _EagerConst: Dst tensor is not initialized.

  • @kennyhnsom
    @kennyhnsom 5 місяців тому

    I have an error that keras has no attribute sequential. How do I solve this error?

  • @darktarifa7200
    @darktarifa7200 3 роки тому

    Great video, the pitty is that i have a rx580, is there any way to use my card ? thanks in advance

    • @prvs2004
      @prvs2004 2 роки тому

      You can, explore AMD options and install necessary drivers. TF auto picks up in case of Nvidia Cuda, you will have to check how it would behave against AMD.

  • @kuldip331
    @kuldip331 3 роки тому +1

    Sir, one class for Exploratory Data Analysis. Please..

    • @codebasics
      @codebasics  3 роки тому

      sure. I have covered EDA in my pandas tutorials series. Also in my machine learning projects, please watch those.

  • @ojaskulkarni6038
    @ojaskulkarni6038 11 місяців тому +2

    Why do we need to use one hot encoding in this tutorial? Our output is already mapped from 0 to 9 right?

    • @NitinKumar-wm2dg
      @NitinKumar-wm2dg 10 місяців тому

      i have the same question, if you know, can you please tell me why?

    • @r0cketRacoon
      @r0cketRacoon 3 місяці тому

      @@NitinKumar-wm2dg i have the same question, if you know, can you please tell me why?

  • @notinrange
    @notinrange 2 роки тому

    Sir I have AMD Radeaon GPU supports open CL so how can i download this?

  • @devloper_hs
    @devloper_hs 2 роки тому

    Sir 50 epochs is giving me an accuracy of 0.1 and a loss of 2.3 , for me 35 epoch were fine bur i guess model underfits

  • @KD8-3.8
    @KD8-3.8 3 роки тому

    Hi, I have amd graphic card and cuda only support nvidia gpu's what can ı do?

  • @dharikarsath8852
    @dharikarsath8852 2 роки тому +2

    why one hot encoding of Target Variable??? why not use the same output data as it is ?

    • @tsai301103
      @tsai301103 Рік тому +1

      if representing your target classes with the numbers 1, 2, and 3, the model may interpret class 2 as being "in between" classes 1 and 3, rather than being a distinct class. This can lead to incorrect predictions and poor performance on the classification task.

    • @r0cketRacoon
      @r0cketRacoon 3 місяці тому +1

      @@tsai301103 why dont he use it for handwritten digits classification (mnist) on tutorial 7

  • @omkaranabathula1979
    @omkaranabathula1979 Рік тому

    Can someone tell me what is the name of the model in which this project is working?

  • @work-dw2hl
    @work-dw2hl 3 роки тому

    sir, already you use the flatten function in model building then again why you use the x_train_scled

    • @dec13666
      @dec13666 3 роки тому

      Because the Flatten parameter belongs to the model definition, and so it does NOTHING to X_train_scaled. Therefore you must use it anyways, as input to your model.

  • @bonalareddy5339
    @bonalareddy5339 3 роки тому

    may be you should increase the font size of code.

  • @AlonAvramson
    @AlonAvramson 2 роки тому

    On my laptop the list_physical_devices() found an additional device: '/XLA_CPU:0' but it could not be used with the model

    • @prvs2004
      @prvs2004 2 роки тому

      It can but will take more time as demonstrated

  • @sahilsharma9385
    @sahilsharma9385 2 роки тому

    I just have one quesiton, why are we doing hot label encoding when we have our y_train in the number itself?

    • @lakshsinghania
      @lakshsinghania Місяць тому

      thats what my doubt lies in, even for the digits classification we had categorical values why didnt we do OHE for that ?

  • @adilkhan3348
    @adilkhan3348 2 роки тому +2

    why do we need one hot encoded output values?

    • @r0cketRacoon
      @r0cketRacoon 3 місяці тому

      have u figure out the answer?

  • @saurabhsingh3459
    @saurabhsingh3459 2 роки тому

    Hi Dhaval, I don't have GPU but still mt code is running tf.device('/GPU:0'): May i know the reason? Please....

  • @NIKHIL-vn1wu
    @NIKHIL-vn1wu 2 роки тому +1

    Sir my GPU and CPU time are comming same, it is happening because my GPU is not strong

  • @ashishthomas5562
    @ashishthomas5562 7 місяців тому

    Why didn't we need to OHE the MNIST database?

  • @chintupawan
    @chintupawan 2 місяці тому

    if any one using tensorflow recent versions like 2.16.1, When converting y vars to categorical you dont need to specify dtype which means you can simply do this y_train_categorical = keras.utils.to_categorical(y_train,num_classes=10)

  • @anirudhsrivastava3530
    @anirudhsrivastava3530 2 роки тому

    Dhawal sir iska kya krna h GPU test pe :
    Failed copying input tensor from /job:localhost/replica:0/task:0/device:CPU:0 to /job:localhost/replica:0/task:0/device:GPU:0 in order to run _EagerConst: Dst tensor is not initialized

  • @r0cketRacoon
    @r0cketRacoon 3 місяці тому

    wwhy tf.config.experimental.list_physical_devices() dont have gpu?

  • @aniruddhapal1997
    @aniruddhapal1997 3 роки тому

    Total no. of X_train is 50000, but while compiling the model why it is showing 1563 samples? Can someone clarify ???

    • @dec13666
      @dec13666 3 роки тому +3

      Keep in mind that in this video, the parameter "batch_size" of "model.fit()" was NOT used. If you go to Keras oficial documentation, on the parameter "batch_size" description, you'll see that "If unspecified, batch_size will default to 32" (keep this 32 in mind). The number you mention corresponds to some hyperparameter called "number of batches", and is calculated by dividing: total number of samples / batch size. If you replace everything, you'll get: 50000 / 32 = 1562.5, which is approximately that 1563 you saw. Hope it helped.
      Source: keras.io/api/models/model_training_apis/

  • @mukulgupta4244
    @mukulgupta4244 3 роки тому

    In my code fit() shows 96% accuracy and loss 0.1, but in evaluate it is very different, accuracy = 53% and loss = 3. Can someone please explain what am I doing wrong?

    • @dec13666
      @dec13666 3 роки тому +10

      You're not doing anything wrong, you actually get those results if you followed this tutorial. Remember that when your model is training, it is passing the whole dataset as much times as there are epochs (if you set epochs=50, then it means it will pass the whole dataset 50 times)... And so eventually it will "memorize" the dataset (which generates that 96% accuracy, which might look "good" at first sight)... But you DO NOT want your model to "memorize training data", since as you could witness yourself, when your model "sees new data" (a.k.a. test set), it will fail one sample after another, and generate awful real results, just as you have got: 53%. This effect is called "overfitting", and so, you could search in the web "how to reduce overfitting in neural networks", so you know what are your options to achieve better results. Plus, I also suggest searching "Accuracy Trap", so you also find out as to why a high accuracy, might keep meaning "(hidden) bad results". Cheers.

  • @anushkajain9529
    @anushkajain9529 3 роки тому

    Hi , can you please do a video on which optimizer and loss functions to choose for building the model.
    Thanks

    • @dec13666
      @dec13666 3 роки тому

      Hello, by own experience, the question you've asked would be enough to complete a whole series of videos... Have you tried checking Keras documentation?
      Optimizers: keras.io/api/optimizers/
      Loss functions: keras.io/api/losses/

  • @hardikvegad3508
    @hardikvegad3508 3 роки тому

    how to run a deep learning model on GPU
    Radeon (TM) R7 M445
    Discrete/Hybrid
    it would be great help...if you provide a solution for this.

    • @codebasics
      @codebasics  3 роки тому +2

      If you have tensorflow2.0 installed, by default it will use GPU. you dont need to do anything special. just use this and make sure it shows GPU in the list of available devices:
      tf.config.experimental.list_physical_devices()

    • @hardikvegad3508
      @hardikvegad3508 3 роки тому

      @@codebasics okay thank you very much sir 🙏🏻

  • @03_afshanahmedkhan39
    @03_afshanahmedkhan39 Рік тому +4

    Accuracy was very low 54% , you smartly hide it , it would be better if you could tell us some ways to inrease accuracy of the model

  • @geekyprogrammer4831
    @geekyprogrammer4831 Рік тому

    Even now, getting GPU to work is very difficult and are still not stable :'(

  • @renegadezed
    @renegadezed Рік тому

    what if you dont have an Nvidia GPU, but you have an AMD GPU?

  • @jaaacker_
    @jaaacker_ 2 роки тому

    I am getting accuracy less then 1% , can somebody help what is wrong ?

    • @prvs2004
      @prvs2004 2 роки тому

      Increase hidden layers and explore loss options

    • @INDIAN_SHADHU
      @INDIAN_SHADHU 2 роки тому

      Do Data standardization

  • @RajaKumar-hg9wl
    @RajaKumar-hg9wl 2 роки тому +1

    I ran it. This is the output:
    Hidden Layer CPU GPU
    1 30.9 Sec 21.1 Sec
    5 2 Min 58 Sec 21.3 Sec
    Surprisingly for 1 Epoch CPU and GPU not much difference also, For GPU 1 Vs 5 Epochs not much difference.

  • @vishaljaiswar6441
    @vishaljaiswar6441 2 роки тому

    You are doing a tremendous job. Thanks for the video