PyTorch Tutorial 16 - How To Use The TensorBoard

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น • 71

  • @flamboyantperson5936
    @flamboyantperson5936 4 ปีที่แล้ว +23

    Finally my search on youtube ends here. I wanted someone who uses OOPS in python to solve machine learning problems and you are the only person on youtube who does this. Thank you so much. I request you please please please make more videos and more frequently on ML using OOPS

    • @patloeber
      @patloeber  4 ปีที่แล้ว +1

      Thank you for watching! Glad you like it :)

    • @AshishVerma-hl9il
      @AshishVerma-hl9il ปีที่แล้ว

      Pytorch is more pythonic and easy to learn

  • @starblasters8
    @starblasters8 ปีที่แล้ว +3

    Haven't finished the video yet so I apologize if you already fixed this / went over it. But I noticed around the 9 minute mark we're told to use "writer.add_graph(model, example_data.reshape(-1, 28*28))" which works, but only if you're using the CPU. As example_data is currently on the CPU (unless I did something wrong which is very possible). I'm using a GPU and all that was needed for me to fix it was change that to "writer.add_graph(model, example_data.reshape(-1, 28*28).to(device))" and boom problem solved. Anyways, awesome tutorials!!!

  • @skymanaditya
    @skymanaditya 3 ปีที่แล้ว +13

    Nice tutorial, I just have one concern. Suppose that your batch_size is 64, in that case, you would have a total of 938 batches, with the first 937 batches having 64 examples, and the last batch having 32 examples. If we specify, (i+1)%100 == 0, then we are computing the average loss and accuracy for the 100 steps. But when the value of i exceeds 900, you would accumulate the loss and correct predictions for the remaining 38 batches, and then add them in the next epoch when the number of steps becomes a factor of 100 again (in this case 100). So, essentially, you would be computing the loss as [loss (38 steps from the last epoch) + loss (100 steps from the current epoch)] / (100) which would increase your loss and also increase the accuracy. Just wanted to highlight this. A good idea would be to add another variable called steps_seen, which is incremented every time a batch/step is processed and set that to 0 similar to running loss and correct predictions. In this way, even when you compute the loss when the current step is not an absolute factor of 100, you would still compute the loss and accuracy as -> [loss (38 steps from the previous epoch) + loss (100 steps from the current epoch)] / (38 + 100).

  • @raminessalat9803
    @raminessalat9803 4 ปีที่แล้ว +8

    Great Vid! I think you shouln't have appended predicted to your labels because that not the ground truth (correct label) and it is the estimated/predicted label, thats why you get a perfect PR curve

    • @anonim5052
      @anonim5052 8 หลายเดือนก่อน

      ty man. You are right, it should be labels.append(labels1)

  • @mudloc3745
    @mudloc3745 3 ปีที่แล้ว +1

    very helpful! thanks. please keep uploading more tutorial for pytorch

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      Thanks, will do!

  • @garrettf245
    @garrettf245 3 ปีที่แล้ว +1

    This was really helpful, thank you!

  • @MKim-nc7gr
    @MKim-nc7gr ปีที่แล้ว

    This helped me a lot. Thanks for your kind explanation!

  • @miscelanea5351
    @miscelanea5351 4 ปีที่แล้ว +1

    Excelent explanation! extremely useful, thanks

    • @patloeber
      @patloeber  4 ปีที่แล้ว

      Glad you like it!

  • @SurajSubbarao
    @SurajSubbarao 4 ปีที่แล้ว +2

    Just finished the pytorch playlist. Loved your content. Will you making tutorials on RNN and LSTM with pytorch?

    • @patloeber
      @patloeber  4 ปีที่แล้ว +1

      Thanks for watching! Hopefully in the near future :)

    • @sumithhh9379
      @sumithhh9379 4 ปีที่แล้ว

      @@patloeber Waiting for LSTM and RNN.

  • @xinqiaozhao5154
    @xinqiaozhao5154 4 ปีที่แล้ว +3

    Hello, there is one issue in the line writer.add_graph, example_data should add a .to(device) function. And I have a question about the use of torch.stack, is the aim of this operation is transforming the data type of per batch from list to tensor? I'm a little confused

    • @patloeber
      @patloeber  4 ปีที่แล้ว

      Thanks for pointing this out. Yes we want to convert a list to a tensor because writer.add_pr_curve() needs tensors or numpy arrays. (You can check the size with labels.shape and preds.shape. Maybe then it gets a little clearer

  • @elise8619
    @elise8619 หลายเดือนก่อน

    For people using this with Jupyter notebooks/labs in a virtual environment, I had problems getting TensorBoard to connect. I had to run TensorBoard within the Jupyter notebook with:
    %load_ext tensorboard
    %tensorboard --logdir runs
    Which also opens the tensorboard within a jupyter cell.

  • @helloansuman
    @helloansuman 7 หลายเดือนก่อน

    can you able to add a pretrained object detection code?

  • @hazemahmed8333
    @hazemahmed8333 4 ปีที่แล้ว +1

    thank you so much!! this really amazing

    • @patloeber
      @patloeber  4 ปีที่แล้ว

      Glad you like it :)

  • @fatemehbehrad7161
    @fatemehbehrad7161 2 ปีที่แล้ว

    Thank you so much for this helpful tutorial. 🍀🙏

  • @anirudhgangadhar6158
    @anirudhgangadhar6158 ปีที่แล้ว +1

    Hi Patrick, I followed this tutorial but when I run the code and refresh the url, TensorBoard is not showing any images for me. Nothing happens, it just shows - "No dashboards are active for the current data set."
    NOTE: I am running the program in Jupyter Notebook.

    • @HassamBaig-p1w
      @HassamBaig-p1w ปีที่แล้ว

      same is happening with me on anaconda vscode

  • @sarahjamal86
    @sarahjamal86 4 ปีที่แล้ว

    Very well done!
    I am watching your videos to revise my info. :D

    • @patloeber
      @patloeber  4 ปีที่แล้ว +1

      Great 👍🏻

  • @sumithhh9379
    @sumithhh9379 4 ปีที่แล้ว +2

    Please make more videos on Pytorch concepts

  • @nougatschnitte8403
    @nougatschnitte8403 2 ปีที่แล้ว +1

    Hello, why do you append the predicted data, when the documentation says that it needs to be ground truth? I find that a bit confusing :(

  • @dinamoses4893
    @dinamoses4893 3 ปีที่แล้ว +1

    Another great tutorial, thanks a lot! I have a small question: how can I clear TensorBoard?

    • @fkeyvan
      @fkeyvan 2 ปีที่แล้ว

      rm -rf ./logs/

  • @anonim5052
    @anonim5052 8 หลายเดือนก่อน

    Why we see two lines on the graph for training and accuracy graphs in tensorboard?

  • @saleemjamali3521
    @saleemjamali3521 3 ปีที่แล้ว +1

    sir could you upload videos on audio dataset by using pytorch?

  • @kaviyarasanpr
    @kaviyarasanpr 4 หลายเดือนก่อน

    what is the advantage of using tensorboard? we could just use matplot lib to visualise it right?

  • @seyeeet8063
    @seyeeet8063 4 ปีที่แล้ว +1

    @2:57 do you know how I can change the localhost address if I wish to?

  • @sumitvaise5452
    @sumitvaise5452 3 ปีที่แล้ว

    Very clear. Thanks

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      Glad you like it!

  • @abhilash.s
    @abhilash.s 4 ปีที่แล้ว +6

    Can please make a tutorial on "How to use Weights and Biases"

  • @seyeeet8063
    @seyeeet8063 4 ปีที่แล้ว

    Hmmm shouldnot the last line of the code in line 157 the writer.close() be out of the for loop? what does the writer.close() do basically?

  • @ashwinshetgaonkar6329
    @ashwinshetgaonkar6329 2 ปีที่แล้ว

    For running acc computation formula should be correct_count/(100*batch_size)

  • @abderrahmanebououden5173
    @abderrahmanebououden5173 4 ปีที่แล้ว

    Hi sir, I have a problem in tensorboard with pytorch. the writer object can't be detected by tensorboard . "No dashboards are active for the current data set."

    • @patloeber
      @patloeber  4 ปีที่แล้ว +1

      hmm. maybe uninstall torch and tensorboard, and make a clean re-installation

  • @cindinishimoto9528
    @cindinishimoto9528 4 ปีที่แล้ว

    Hey, Patrick, thanks for the great Pytorch series. I hope you can keep making it and please send my special hugs to your single (and handsome) German friends... haha

    • @patloeber
      @patloeber  4 ปีที่แล้ว +1

      Haha glad you like it :) Thank you and greetings back to Brazil :)

  • @krishnachauhan2822
    @krishnachauhan2822 3 ปีที่แล้ว

    This tensorboard --logdir run is giving syntax error. What to do
    ??

  • @ea005-i7j
    @ea005-i7j 4 ปีที่แล้ว

    Hello Python Engineer, thank you for this video, I relly found it helpful. I am having one challenge though, how can I run the visualisation on a gpu server (nvidia gou) that I want to use for my training?

  • @ShahabShokouhi
    @ShahabShokouhi 10 หลายเดือนก่อน

    Why are dividing running loss by 100?

  • @henningschopper2264
    @henningschopper2264 2 ปีที่แล้ว

    Maybe a little late to the party. Nice Tutorial. The code for deriving a pr curve is particularly helpful. However, there is something wrong with the results. A "perfect" pr-curve (step function at "1") makes no sense. The curve should "fall off" as it approaches "1". Secondly: If you had built in a global step over several evaluation runs, then you could also have glided over the different PR curves in the tensor board, which is nice to see how the model learns.

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 4 ปีที่แล้ว

    ImportError: cannot import name 'SummaryWriter' from 'torch.utils.tensorboard'
    do we need to update to tensorboardX?
    github.com/lanpa/tensorboardX/issues/19

    • @patloeber
      @patloeber  4 ปีที่แล้ว

      Hmm I had some issues too in the past, and for me an uninstall and clean new install of pytorch and tensorboard solved the problem

  • @yi-yunhsieh1330
    @yi-yunhsieh1330 3 ปีที่แล้ว

    May I ask ur VScode theme? Thank u

    • @patloeber
      @patloeber  3 ปีที่แล้ว +1

      I've used different ones over time. I think in this video it's Monokai. I also like Night Owl and Dracula

    • @yi-yunhsieh1330
      @yi-yunhsieh1330 3 ปีที่แล้ว

      @@patloeber Thank you very much!

  • @pakhomovviktor3149
    @pakhomovviktor3149 4 ปีที่แล้ว +1

    line 82 of your github code. You probably should .to(device) reshaped data?

    • @patloeber
      @patloeber  4 ปีที่แล้ว

      if you mean this line writer.add_graph(model, example_data.reshape(-1, 28*28)), then no, this is just for the tensorboard. no need to put it on the gpu

  • @fkeyvan
    @fkeyvan 2 ปีที่แล้ว

    German ingenuity again.

  • @razi_official
    @razi_official 4 ปีที่แล้ว

    hello python engineer! i am facing an issue, I have successfully installed tensorboard and it is running fine as well, whenever I try to run my code file and then refresh the tensorboard browser but it doesn't show any thing like images and graphs etc, one thing is very strange it is not showing any error too. but why I am not getting all images and graphs on the tensorboard browser..
    please give me any solution,
    I am using your given code to practice

    • @patloeber
      @patloeber  4 ปีที่แล้ว +1

      Did you specify the correct log directory?

    • @razi_official
      @razi_official 4 ปีที่แล้ว

      @@patloeber yes i specified. i got printed the images on terminal it is showing but not showing on tensorboard

    • @jdpalaciob
      @jdpalaciob 4 ปีที่แล้ว +3

      @@razi_official greetings. I had the same problem. My code pointed to the correct directory, but I was executing tensorboard --logdir in the terminal standing in another directory. To be clear, I was one directory level above my code, therefore I had to call the specific directory in which I had the code and then start the "server" of tensorboard standing in that same directory

    • @Zebbie86
      @Zebbie86 3 ปีที่แล้ว

      @@jdpalaciob Thanks a lot!

  • @YouKnowWhoIAm118
    @YouKnowWhoIAm118 3 ปีที่แล้ว

    Are you from Germany? :)

  • @favremirko6031
    @favremirko6031 2 ปีที่แล้ว

    0

  • @favremirko6031
    @favremirko6031 2 ปีที่แล้ว

    0000

  • @texwiller7577
    @texwiller7577 2 หลายเดือนก่อน

    This is not the way you should make videos. Monotonic voice etc....