How to convert almost any PyTorch model to ONNX and serve it using flask

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

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

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

    Nice video, it helped alot. I follow you everywhere . thanks for this Abhishek Bhai

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

    Thank you for all the videos and all the PyTorch gyan :)

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

    hello Thakur, thanks for your awesome video, but i have one problem when i converting my models, It's a bert-like model, when i attempt to convert it, here raised an error, "RuntimeError: Unsupported: ONNX export of Slice with dynamic inputs. DynamicSlice is a deprecated experimental op." could you tell me what that mean and what should i do to handle this? Thank you a lot!

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

    Thanks for another good informative video. Which Pytorch extension do u use. It seems very good.

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

    The video is really helpful but I already have the fine-tuned model (PEGASUS) on colab so is it going to be any different from this scenario?
    Note: the model is fine-tuned using huggingface

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

    Hello abhishek, good stuff. Can you take on a kaggle competetion using tensorflow please end-end flow like the one you did for pytorch(Bengali Handwritten Dataset). That would be super helpful. btw excellent stuff.

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

    Thanks for yet another applied ML video. Wondering if we can get batch predictions from model served on flask?

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

      Thank you. Yes, you definitely can. A simple way would be to use a separator like semicolon. split the sentences and then change the sentence predict function to handle multiple sentences.
      I can possibly show how to do it in one of the future videos or maybe just push batch api to github repo.

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

      @@abhishekkrthakur Thank you.. It would definitely help! Guessing pushing to your github repo would be faster :)

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

    Thanks for the video

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

    Thanks, Great content!

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

    If my pytorch model has a dictionary as output, with keywords 'classification' and 'regression', can I export it to .onnx? Thanks!

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

    Thanks for Sharing.

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

    So... with ONNX, we don't need to use jit.trace for logic in Pytorch?

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

      I had the same question, I saw this in one of the issues raised in pytorch

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

    THANK YOU!

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

    I have been trying to convert a longformer question answering model (which I trained) to onnx. I am, unfortunately, getting the following error: "RuntimeError: Only consecutive 1-d tensor indices are supported in exporting aten::index_put to ONNX." I haven't been able to either understand it or get around it, can someone shed some light as to how this can be fixed?

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

    If the run time for Pytorch on CPU and ONNX is almost the same, what is the point of converting?

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

      well, its more about portability. try converting an lstm model and then check speed :)
      also, i didnt do a few optimizations. it seems like some optimizations will also improve the speed

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

      Abhishek Thakur Good to know, thanks for the insight!

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

    After this video I thought of giving it a try., but it didn’t work and we suffered a lot. We are working on text generation problem.
    Could anyone help ?

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

    Good!How do I convert the PT model to TensorRT engine?

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

      convert it to onnx first and then use tensorrt to optimize the inference.

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

    Bahi mera kaam sirf video like karna rah gaya hai. Samujh me to aane se raha ;-/

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

      haha. gimme some suggestions for what you want to see :)

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

      @@abhishekkrthakur multi task learning