{
  "id": 406250,
  "title": "In case you are wondering why Pix2Struct, MatCha, Deplot don't train properly",
  "url": "/competitions/benetech-making-graphs-accessible/discussion/406250",
  "author_name": "Nicholas Broad",
  "post_date": "2023-05-01T16:39:03.681000",
  "votes": 42,
  "comment_count": 133,
  "views": 0,
  "content": "<p>You should read this thread: <a href=\"https://github.com/huggingface/transformers/issues/22903\" target=\"_blank\">https://github.com/huggingface/transformers/issues/22903</a></p>\n<p>tldr: make sure to set <code>model.config.text_config.is_decoder=True</code> and don't use label smoothing. It should produce 60+ scores then</p>\n<p>If you do <code>pip install git+https://github.com/huggingface/transformers.git</code>, then it should work fine without any modifications</p>",
  "messages": [
    {
      "id": 2241608,
      "postDate": "2023-05-01T16:39:03.680Z",
      "content": "<p>You should read this thread: <a href=\"https://github.com/huggingface/transformers/issues/22903\" target=\"_blank\">https://github.com/huggingface/transformers/issues/22903</a></p>\n<p>tldr: make sure to set <code>model.config.text_config.is_decoder=True</code> and don't use label smoothing. It should produce 60+ scores then</p>\n<p>If you do <code>pip install git+https://github.com/huggingface/transformers.git</code>, then it should work fine without any modifications</p>",
      "rawMarkdown": "You should read this thread: https://github.com/huggingface/transformers/issues/22903\n\ntldr: make sure to set `model.config.text_config.is_decoder=True` and don't use label smoothing. It should produce 60+ scores then\n\n\nIf you do `pip install git+https://github.com/huggingface/transformers.git`, then it should work fine without any modifications",
      "votes": 42
    },
    {
      "id": 2300948,
      "postDate": "2023-06-13T14:27:14.523Z",
      "content": "<p>Thanks for sharing <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> !</p>\n<p>Have you tired inference with Pix2Struct, MatCha or DePlot? If so were the results reasonable?</p>\n<p>Keep up with the great work🔥💪</p>",
      "rawMarkdown": "Thanks for sharing @nbroad !\n\nHave you tired inference with Pix2Struct, MatCha or DePlot? If so were the results reasonable?\n\nKeep up with the great work🔥💪",
      "votes": 1,
      "replies": [
        {
          "id": 2301462,
          "postDate": "2023-06-14T00:59:25.973Z",
          "content": "<p>My current score 0.65 is using matcha</p>",
          "rawMarkdown": "My current score 0.65 is using matcha",
          "votes": 2,
          "replies": [
            {
              "id": 2301651,
              "postDate": "2023-06-14T04:39:49.860Z",
              "content": "<p>We are using Matcha for our submission as well. Hyperparameter tuning is a massive pain but it can bring good scores</p>",
              "rawMarkdown": "We are using Matcha for our submission as well. Hyperparameter tuning is a massive pain but it can bring good scores",
              "votes": 2
            },
            {
              "id": 2309834,
              "postDate": "2023-06-19T23:28:39.023Z",
              "content": "<p>Really interesting, <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> <a href=\"https://www.kaggle.com/cody11null\" target=\"_blank\">@cody11null</a> ! </p>\n<p>I have been playing out with DePlot, but have not explored Matcha yet…. Curious to see how you guys approached this challenge!</p>",
              "rawMarkdown": "Really interesting, @nbroad @cody11null ! \n\nI have been playing out with DePlot, but have not explored Matcha yet.... Curious to see how you guys approached this challenge!"
            }
          ]
        }
      ]
    },
    {
      "id": 2280277,
      "postDate": "2023-05-30T02:40:18.673Z",
      "content": "<p>Thanks for your sharing!  <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> </p>\n<p>tried matcha models &amp; pix2struct,  only got highest 0.6 cv in local.</p>\n<ul>\n<li>lr 4e-5</li>\n<li>epochs 2</li>\n<li>batch size 2</li>\n<li>Adam</li>\n<li>no prompt</li>\n</ul>\n<p>do you pass any prompts to model?  (just like deplot inputs = processor(images=image, text=\"Generate underlying data table of the figure below:\", return_tensors=\"pt\"))</p>",
      "rawMarkdown": "Thanks for your sharing!  @nbroad \n\ntried matcha models & pix2struct,  only got highest 0.6 cv in local.\n- lr 4e-5\n- epochs 2\n- batch size 2\n- Adam\n- no prompt\n\ndo you pass any prompts to model?  (just like deplot inputs = processor(images=image, text=\"Generate underlying data table of the figure below:\", return_tensors=\"pt\"))",
      "votes": 1,
      "replies": [
        {
          "id": 2301652,
          "postDate": "2023-06-14T04:40:32.450Z",
          "content": "<p>You should be able to do more than 2 epochs, though I am surprised that 2 only bring .6 CV</p>",
          "rawMarkdown": "You should be able to do more than 2 epochs, though I am surprised that 2 only bring .6 CV",
          "votes": 1
        },
        {
          "id": 2305356,
          "postDate": "2023-06-16T16:11:45.253Z",
          "rawMarkdown": "",
          "votes": 1,
          "isDeleted": true,
          "replies": [
            {
              "id": 2305359,
              "postDate": "2023-06-16T16:14:28.647Z",
              "rawMarkdown": "",
              "isDeleted": true
            }
          ]
        }
      ]
    },
    {
      "id": 2273592,
      "postDate": "2023-05-25T09:03:46.760Z",
      "content": "<p>may I know your MatCha inference  speed, my model inference is too slow and always time out.</p>",
      "rawMarkdown": "may I know your MatCha inference  speed, my model inference is too slow and always time out.",
      "votes": 1,
      "replies": [
        {
          "id": 2273890,
          "postDate": "2023-05-25T13:39:45.480Z",
          "content": "<p>My training is taking close to 7 hours and my inference on LB is about 2.5 hours I believe. </p>",
          "rawMarkdown": "My training is taking close to 7 hours and my inference on LB is about 2.5 hours I believe. ",
          "votes": 3,
          "replies": [
            {
              "id": 2279763,
              "postDate": "2023-05-29T15:53:57.110Z",
              "content": "<p>training is 6.5 hours, inference is about 2 hours</p>",
              "rawMarkdown": "training is 6.5 hours, inference is about 2 hours",
              "votes": 2
            },
            {
              "id": 2281613,
              "postDate": "2023-05-31T03:10:05.127Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2283762,
              "postDate": "2023-06-01T13:35:55.540Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2285235,
              "postDate": "2023-06-02T14:49:52.543Z",
              "content": "<p>Really? Shouldn't deplot be a better option since it is fine-tuned on matcha itself and it specifically trained for plot-to-table?</p>",
              "rawMarkdown": "Really? Shouldn't deplot be a better option since it is fine-tuned on matcha itself and it specifically trained for plot-to-table?"
            }
          ]
        }
      ]
    },
    {
      "id": 2265780,
      "postDate": "2023-05-19T14:01:40.427Z",
      "content": "<p>how will you download as the submission is without the internet?</p>",
      "rawMarkdown": "how will you download as the submission is without the internet?\n",
      "votes": 1,
      "replies": [
        {
          "id": 2265819,
          "postDate": "2023-05-19T14:29:35.510Z",
          "content": "<p>There is a good discussion <a href=\"https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/410130\" target=\"_blank\">here</a> that shows how to do this.</p>",
          "rawMarkdown": "There is a good discussion [here](https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/410130) that shows how to do this.",
          "votes": 1,
          "replies": [
            {
              "id": 2300943,
              "postDate": "2023-06-13T14:23:42.070Z",
              "content": "<p>Thanks for sharing <a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> !</p>",
              "rawMarkdown": "Thanks for sharing @brendanartley !"
            }
          ]
        }
      ]
    },
    {
      "id": 2255915,
      "postDate": "2023-05-12T05:18:37.637Z",
      "content": "<p>Hi Nicholas, did you try to submit a notebook that uses the DePlot model? I found that the model is trying to download something from the Internet and this will cause the run to fail. Did you figure out a way to solve this problem? </p>",
      "rawMarkdown": "Hi Nicholas, did you try to submit a notebook that uses the DePlot model? I found that the model is trying to download something from the Internet and this will cause the run to fail. Did you figure out a way to solve this problem? ",
      "votes": 1,
      "replies": [
        {
          "id": 2257019,
          "postDate": "2023-05-12T23:40:53.747Z",
          "content": "<p>deplot downloads the font file with the following code</p>\n<p><a href=\"https://github.com/huggingface/transformers/blob/cf11493dce0a1d22446efe0d6c4ade02fd928e50/src/transformers/models/pix2struct/image\" target=\"_blank\">https://github.com/huggingface/transformers/blob/cf11493dce0a1d22446efe0d6c4ade02fd928e50/src/transformers/models/pix2struct/image</a> _processing_pix2struct.py#L129</p>\n<p>Here is the file that is being loaded.<br>\n<a href=\"https://huggingface.co/ybelkada/fonts\" target=\"_blank\">https://huggingface.co/ybelkada/fonts</a></p>\n<p>If you upload the above file to Datasets, you can use it on Internet Off.</p>",
          "rawMarkdown": "deplot downloads the font file with the following code\n\nhttps://github.com/huggingface/transformers/blob/cf11493dce0a1d22446efe0d6c4ade02fd928e50/src/transformers/models/pix2struct/image _processing_pix2struct.py#L129\n\nHere is the file that is being loaded.\nhttps://huggingface.co/ybelkada/fonts\n\nIf you upload the above file to Datasets, you can use it on Internet Off.",
          "votes": 3,
          "replies": [
            {
              "id": 2302774,
              "postDate": "2023-06-14T19:21:14.370Z",
              "content": "<p>thank you!! I spend an hour attempting to fix the bug…</p>",
              "rawMarkdown": "thank you!! I spend an hour attempting to fix the bug..."
            },
            {
              "id": 2302911,
              "postDate": "2023-06-15T00:46:58.257Z",
              "content": "<p>You can pass the path to the file when you call the processor. </p>\n<p><code>processor(images=images, text=text, font_path=\"path/to/Arial.TTF\")</code></p>",
              "rawMarkdown": "You can pass the path to the file when you call the processor. \n\n`processor(images=images, text=text, font_path=\"path/to/Arial.TTF\")`"
            }
          ]
        },
        {
          "id": 2262147,
          "postDate": "2023-05-16T18:54:02.057Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/jiayoufan666\" target=\"_blank\">@jiayoufan666</a> if you use <code>Pix2StructProcessor.from_pretrained(..., is_vqa=False)</code> it will not load the font since it doesn't need to call the <code>render_header</code> method when preprocessing, which includes the part of code that downloads the .TTF file.</p>",
          "rawMarkdown": "Hi @jiayoufan666 if you use `Pix2StructProcessor.from_pretrained(..., is_vqa=False)` it will not load the font since it doesn't need to call the `render_header` method when preprocessing, which includes the part of code that downloads the .TTF file.",
          "votes": 4,
          "replies": [
            {
              "id": 2270753,
              "postDate": "2023-05-23T11:35:12.227Z",
              "content": "<p>Hi Sarvazyan, Could you give some hints regarding the training using Pix2StructProcessor.from_pretrained().</p>",
              "rawMarkdown": "Hi Sarvazyan, Could you give some hints regarding the training using Pix2StructProcessor.from_pretrained()."
            },
            {
              "id": 2277461,
              "postDate": "2023-05-27T19:25:20.553Z",
              "content": "<p><a href=\"https://www.kaggle.com/pksamantaray\" target=\"_blank\">@pksamantaray</a> , <a href=\"https://www.kaggle.com/code/heyytanay/training-pix2struct-pytorch-amp-w-b\" target=\"_blank\">this notebook</a> shows how to train pix2struct/matcha/deplot models</p>",
              "rawMarkdown": "@pksamantaray , [this notebook](https://www.kaggle.com/code/heyytanay/training-pix2struct-pytorch-amp-w-b) shows how to train pix2struct/matcha/deplot models"
            }
          ]
        }
      ]
    },
    {
      "id": 2241852,
      "postDate": "2023-05-01T21:50:59.397Z",
      "content": "<p>Thanks for sharing. Have you tried it yet?</p>",
      "rawMarkdown": "Thanks for sharing. Have you tried it yet?",
      "votes": 1,
      "replies": [
        {
          "id": 2241941,
          "postDate": "2023-05-02T01:03:22.660Z",
          "content": "<p>Yes. It works</p>",
          "rawMarkdown": "Yes. It works",
          "votes": 1
        }
      ]
    },
    {
      "id": 2242142,
      "postDate": "2023-05-02T04:09:15.427Z",
      "content": "<p>Thanks. Do these models work better than donut?</p>",
      "rawMarkdown": "Thanks. Do these models work better than donut?",
      "votes": 2,
      "replies": [
        {
          "id": 2242154,
          "postDate": "2023-05-02T04:26:21.837Z",
          "content": "<p>Yes, my donut approach CV was about 0.44 and my CV for matcha was close to 0.7. I didn't submit for matcha, but my leaderboard score for donut was very close to the CV.</p>",
          "rawMarkdown": "Yes, my donut approach CV was about 0.44 and my CV for matcha was close to 0.7. I didn't submit for matcha, but my leaderboard score for donut was very close to the CV.",
          "votes": 4,
          "replies": [
            {
              "id": 2243684,
              "postDate": "2023-05-03T04:57:06.707Z",
              "content": "<p>How about your training loss after fixing the bug? Mine was very close to 0 but only scored 0.</p>",
              "rawMarkdown": "How about your training loss after fixing the bug? Mine was very close to 0 but only scored 0.",
              "votes": 1
            },
            {
              "id": 2243701,
              "postDate": "2023-05-03T05:28:27.360Z",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>",
              "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&alt=media)",
              "votes": 2
            },
            {
              "id": 2243727,
              "postDate": "2023-05-03T05:48:45.697Z",
              "content": "<p>I am trying to train deplot/ matcha with or without the fix (The latest version seems to have some of the bugs fixed , I've checked the source code) </p>\n<p>However the loss starts around 30 goes down to near 1  (once it hit almost 0.9 ) but also with very bad results ! <br>\nStill I think there is something wrong ! </p>",
              "rawMarkdown": "I am trying to train deplot/ matcha with or without the fix (The latest version seems to have some of the bugs fixed , I've checked the source code) \n\nHowever the loss starts around 30 goes down to near 1  (once it hit almost 0.9 ) but also with very bad results ! \nStill I think there is something wrong ! \n\n",
              "votes": 2
            },
            {
              "id": 2243728,
              "postDate": "2023-05-03T05:49:58.990Z",
              "content": "<p>In my strategy , I pretty much sure I have a puzzle piece missing</p>",
              "rawMarkdown": "In my strategy , I pretty much sure I have a puzzle piece missing",
              "votes": 1
            },
            {
              "id": 2244306,
              "postDate": "2023-05-03T15:05:05.537Z",
              "content": "<p>Try installing from source <code>pip install git+https://github.com/huggingface/transformers.git</code></p>",
              "rawMarkdown": "Try installing from source `pip install git+https://github.com/huggingface/transformers.git`"
            },
            {
              "id": 2244843,
              "postDate": "2023-05-03T23:21:24.073Z",
              "content": "<blockquote>\n  <p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>\n</blockquote>\n<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> Will you plan to submit your new model? I am curious about how it performs on the test dataset.</p>",
              "rawMarkdown": "> ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&alt=media)\n\n@nbroad Will you plan to submit your new model? I am curious about how it performs on the test dataset.",
              "votes": 1
            },
            {
              "id": 2244954,
              "postDate": "2023-05-04T03:28:08.567Z",
              "content": "<p>Sure I can submit</p>",
              "rawMarkdown": "Sure I can submit",
              "votes": 1
            },
            {
              "id": 2245835,
              "postDate": "2023-05-04T16:18:37.360Z",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> is it 800x2 = 1600 data points or 3/4 data?</p>",
              "rawMarkdown": "@nbroad is it 800x2 = 1600 data points or 3/4 data?",
              "votes": 1
            },
            {
              "id": 2246047,
              "postDate": "2023-05-04T19:47:30.837Z",
              "content": "<p><a href=\"https://www.kaggle.com/asalhi\" target=\"_blank\">@asalhi</a> same here, tried training pix2struct for a couple of epochs, loss went ~1.0 and when checking the generated texts it was always outputting nearly the same text.</p>",
              "rawMarkdown": "@asalhi same here, tried training pix2struct for a couple of epochs, loss went ~1.0 and when checking the generated texts it was always outputting nearly the same text.",
              "votes": 1
            },
            {
              "id": 2246051,
              "postDate": "2023-05-04T19:54:47.207Z",
              "content": "<p><a href=\"https://www.kaggle.com/seshurajup\" target=\"_blank\">@seshurajup</a>, what are you referring to?</p>",
              "rawMarkdown": "@seshurajup, what are you referring to?"
            },
            {
              "id": 2246124,
              "postDate": "2023-05-04T22:32:29.383Z",
              "content": "<p>i mean from the training loss <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>",
              "rawMarkdown": "i mean from the training loss ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&alt=media)",
              "votes": 1
            },
            {
              "id": 2246126,
              "postDate": "2023-05-04T22:39:33.273Z",
              "content": "<p>Ah. I trained on all data except for scatter plots because the model does poorly on that anyway and I wanted it to go faster. </p>\n<p>The step corresponds to the logging step which was 100 times per epoch</p>",
              "rawMarkdown": "Ah. I trained on all data except for scatter plots because the model does poorly on that anyway and I wanted it to go faster. \n\nThe step corresponds to the logging step which was 100 times per epoch",
              "votes": 2
            },
            {
              "id": 2246229,
              "postDate": "2023-05-05T02:14:24.577Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2246231,
              "postDate": "2023-05-05T02:18:06.753Z",
              "content": "<p>Try using bf16</p>",
              "rawMarkdown": "Try using bf16"
            },
            {
              "id": 2246246,
              "postDate": "2023-05-05T02:34:38.347Z",
              "content": "<p>Thank you. I will try it.</p>",
              "rawMarkdown": "Thank you. I will try it."
            },
            {
              "id": 2246363,
              "postDate": "2023-05-05T05:11:42.507Z",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> </p>\n<p>I keep getting submission errors (submission file is in the wrong format) when I submit 😔</p>\n<p>The model outputs on a subset of the training data and on the test set look good though</p>\n<p>Maybe <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> can kindly offer some suggestions for what is going wrong 🙏<br>\nIt's probably something silly 😅</p>",
              "rawMarkdown": "@zhugds \n\nI keep getting submission errors (submission file is in the wrong format) when I submit 😔\n\nThe model outputs on a subset of the training data and on the test set look good though\n\n\nMaybe @ryanholbrook can kindly offer some suggestions for what is going wrong 🙏\nIt's probably something silly 😅"
            },
            {
              "id": 2246661,
              "postDate": "2023-05-05T11:01:09.057Z",
              "content": "<p>😣 This happens a lot to me. 80% of my submissions threw exceptions. <br>\nThe line chart is extremely hard to predict because the number of points is not consistent with the number of x values while it should be. Otherwise, no one knows how many points are in tin the graph.</p>",
              "rawMarkdown": "😣 This happens a lot to me. 80% of my submissions threw exceptions. \nThe line chart is extremely hard to predict because the number of points is not consistent with the number of x values while it should be. Otherwise, no one knows how many points are in tin the graph."
            },
            {
              "id": 2246762,
              "postDate": "2023-05-05T12:48:50.767Z",
              "content": "<p>Sorry to hear you're having trouble. I'll try to take a look if I can find some time. (Not trivial to look it up, unfortunately.) For now, I might suggest trying to validate the actual data type based on the predicted chart type. If the chart type implies that the values should be numeric, make sure the values can actually be parsed as numbers. Maybe something like: <code>try: float(x); except: 0.0</code>.</p>\n<p>Since dot plots can be ambiguous, maybe default to numeric on those since numeric can also pass as a string. Unfortunately, dot plots aren't as well represented in the training data which might be why it's passing there but not on submission if that's the culprit.</p>",
              "rawMarkdown": "Sorry to hear you're having trouble. I'll try to take a look if I can find some time. (Not trivial to look it up, unfortunately.) For now, I might suggest trying to validate the actual data type based on the predicted chart type. If the chart type implies that the values should be numeric, make sure the values can actually be parsed as numbers. Maybe something like: `try: float(x); except: 0.0`.\n\nSince dot plots can be ambiguous, maybe default to numeric on those since numeric can also pass as a string. Unfortunately, dot plots aren't as well represented in the training data which might be why it's passing there but not on submission if that's the culprit.",
              "votes": 3
            },
            {
              "id": 2246771,
              "postDate": "2023-05-05T12:59:18.733Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2246957,
              "postDate": "2023-05-05T15:10:02.590Z",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> <br>\nIt looks like models are supposed to choose coordinates corresponding to tick marks on the x-axis for line plots, even though it looks like there are infinite points for some of them.</p>",
              "rawMarkdown": "@zhugds \nIt looks like models are supposed to choose coordinates corresponding to tick marks on the x-axis for line plots, even though it looks like there are infinite points for some of them.",
              "votes": 1
            },
            {
              "id": 2246958,
              "postDate": "2023-05-05T15:11:43.343Z",
              "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> ,</p>\n<p>1) don't worry about looking it up. I'm 95% sure it's a data type issue</p>\n<p>2) I thought <a href=\"https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/398528\" target=\"_blank\">this thread</a> confirmed that the data type didn't matter. If it didn't match, it would just get a score of 0</p>",
              "rawMarkdown": "@ryanholbrook ,\n\n1) don't worry about looking it up. I'm 95% sure it's a data type issue\n\n2) I thought [this thread](https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/398528) confirmed that the data type didn't matter. If it didn't match, it would just get a score of 0"
            },
            {
              "id": 2246960,
              "postDate": "2023-05-05T15:13:40.637Z",
              "content": "<p>Yes, from graph conventions:</p>\n<ul>\n<li>Categorical values always correspond to a tick label on an axis.</li>\n<li>Line graphs always have categorical x-axis values and numeric y-axis values</li>\n<li>The values for the x-axis are the x-axis tick labels beneath some portion of the line graph</li>\n</ul>\n<p>I think annotations are consistent, specially for extracted subset.</p>",
              "rawMarkdown": "Yes, from graph conventions:\n- Categorical values always correspond to a tick label on an axis.\n- Line graphs always have categorical x-axis values and numeric y-axis values\n- The values for the x-axis are the x-axis tick labels beneath some portion of the line graph\n\nI think annotations are consistent, specially for extracted subset.",
              "votes": 3
            },
            {
              "id": 2246973,
              "postDate": "2023-05-05T15:27:15.337Z",
              "content": "<p>I thought it shouldn't… I'll take a look again.</p>",
              "rawMarkdown": "I thought it shouldn't... I'll take a look again."
            },
            {
              "id": 2247313,
              "postDate": "2023-05-05T21:39:49.887Z",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> The error I'm seeing is <code>Submission had an invalid score. Please check your input data for numerical errors (e.g. \"NaN\", division by zero, etc)</code>.</p>\n<p>This actually looks like it's not a data type problem, which would have given a different error (an <code>Evaluation Exception</code>). I'm thinking the metric is processing the submission okay, but the leaderboard is rejecting it for some reason.</p>\n<p>Some things to check:</p>\n<ul>\n<li>all numbers are finite (not inf or nan)</li>\n<li>strings are non-empty</li>\n<li>numeric predictions are non-constant</li>\n</ul>\n<p>I tested the metric for robustness to the last two, but it couldn't hurt. (Those conditions are never true of the ground truth.)</p>",
              "rawMarkdown": "@nbroad The error I'm seeing is `Submission had an invalid score. Please check your input data for numerical errors (e.g. \"NaN\", division by zero, etc)`.\n\nThis actually looks like it's not a data type problem, which would have given a different error (an `Evaluation Exception`). I'm thinking the metric is processing the submission okay, but the leaderboard is rejecting it for some reason.\n\nSome things to check:\n- all numbers are finite (not inf or nan)\n- strings are non-empty\n- numeric predictions are non-constant\n\nI tested the metric for robustness to the last two, but it couldn't hurt. (Those conditions are never true of the ground truth.)",
              "votes": 1
            },
            {
              "id": 2247329,
              "postDate": "2023-05-05T21:59:21.290Z",
              "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a>,</p>\n<p>This is very helpful. I didn't consider the possibility of outputting inf or nan. </p>\n<p>For number 2, would the following data series create an error?</p>\n<p>\"0;1;;2;3\"</p>",
              "rawMarkdown": "@ryanholbrook,\n\nThis is very helpful. I didn't consider the possibility of outputting inf or nan. \n\nFor number 2, would the following data series create an error?\n\n\"0;1;;2;3\""
            },
            {
              "id": 2248122,
              "postDate": "2023-05-06T14:01:30.307Z",
              "content": "<p>I don't <em>think</em> so. I tested the metric with entries like <code>;;;</code> and the Levenshtein metric just treated them as empty strings as it should. My guess is that the first case (inf or nan) is most likely.</p>",
              "rawMarkdown": "I don't *think* so. I tested the metric with entries like `;;;` and the Levenshtein metric just treated them as empty strings as it should. My guess is that the first case (inf or nan) is most likely."
            },
            {
              "id": 2248439,
              "postDate": "2023-05-06T21:06:51.197Z",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> </p>\n<p>I finally got a submission to work. I think it might have predicted something like 13e888 which would turn into inf when converted to a float. </p>\n<p>My score is 0.65 which matches CV (0.68) pretty close</p>",
              "rawMarkdown": "@zhugds \n\nI finally got a submission to work. I think it might have predicted something like 13e888 which would turn into inf when converted to a float. \n\nMy score is 0.65 which matches CV (0.68) pretty close",
              "votes": 8
            },
            {
              "id": 2248448,
              "postDate": "2023-05-06T21:16:06.757Z",
              "content": "<p>Great score<br>\nI am still trying to train deplot, loss is crazy no matter what I do.</p>\n<p>But I will keep digging till I see what I am missing .</p>",
              "rawMarkdown": "Great score\nI am still trying to train deplot, loss is crazy no matter what I do.\n\nBut I will keep digging till I see what I am missing .",
              "votes": 1
            },
            {
              "id": 2248464,
              "postDate": "2023-05-06T21:33:36.177Z",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> are you eliminate Inf/nan is the solution for the successful submission ? Nice to see CV is sable !!</p>",
              "rawMarkdown": "@nbroad are you eliminate Inf/nan is the solution for the successful submission ? Nice to see CV is sable !!",
              "votes": 1
            },
            {
              "id": 2248470,
              "postDate": "2023-05-06T21:47:15.777Z",
              "content": "<p>I think I wasn't directly outputting inf or nan, but when the float conversion happened, it turned into inf (e.g. float(3e999))</p>",
              "rawMarkdown": "I think I wasn't directly outputting inf or nan, but when the float conversion happened, it turned into inf (e.g. float(3e999))",
              "votes": 1
            },
            {
              "id": 2248482,
              "postDate": "2023-05-06T22:23:59.897Z",
              "content": "<p>Awesome! I haven't made it work yet. Not sure what's wrong. <br>\nLocal validation is good, but not for the leaderboard.</p>",
              "rawMarkdown": "Awesome! I haven't made it work yet. Not sure what's wrong. \nLocal validation is good, but not for the leaderboard."
            },
            {
              "id": 2249553,
              "postDate": "2023-05-07T20:48:20.577Z",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> It's so weird that my local validation score is 0.6+, but my submission score is 0.42. I split the images 80/20 for training and validation. Do you know what could go wrong? <br>\nMy initial thought was that the private testing images are different from training images, which was clearly wrong from your case.<br>\n<a href=\"https://www.kaggle.com/asalhi\" target=\"_blank\">@asalhi</a> Does pix2struct work for you? </p>",
              "rawMarkdown": "@nbroad It's so weird that my local validation score is 0.6+, but my submission score is 0.42. I split the images 80/20 for training and validation. Do you know what could go wrong? \nMy initial thought was that the private testing images are different from training images, which was clearly wrong from your case.\n@asalhi Does pix2struct work for you? "
            },
            {
              "id": 2249562,
              "postDate": "2023-05-07T21:04:09.333Z",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> <br>\nThe test set is only extracted images. You might be overfitting to generated images</p>",
              "rawMarkdown": "@zhugds \nThe test set is only extracted images. You might be overfitting to generated images",
              "votes": 1
            },
            {
              "id": 2249566,
              "postDate": "2023-05-07T21:21:22.863Z",
              "content": "<p>Thanks for the tip. That just came to my mind. Did you split the images as you did in the donut training?</p>",
              "rawMarkdown": "Thanks for the tip. That just came to my mind. Did you split the images as you did in the donut training?"
            },
            {
              "id": 2249683,
              "postDate": "2023-05-08T02:37:58.450Z",
              "content": "<p>I think I was able to train matcha ! , it just finished the trainning with loss chart similar to <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> , I tested on solo images and it seems to generate a nice output ! and I directly moved the weights to Kaggle, I am validating now but it seems that it takes a good amount of time to validate ! <br>\n<a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> can you verify the scoring time ? I guess it will be near 9 hours (unless I play with max_length) ? </p>",
              "rawMarkdown": "I think I was able to train matcha ! , it just finished the trainning with loss chart similar to @nbroad , I tested on solo images and it seems to generate a nice output ! and I directly moved the weights to Kaggle, I am validating now but it seems that it takes a good amount of time to validate ! \n@nbroad can you verify the scoring time ? I guess it will be near 9 hours (unless I play with max_length) ? ",
              "votes": 1
            },
            {
              "id": 2249686,
              "postDate": "2023-05-08T02:56:35.330Z",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6915758%2F387a8ff0e75081b20ec4dd414bddebd4%2FScreen%20Shot%202023-05-08%20at%205.53.58.png?generation=1683514558138367&amp;alt=media\" alt=\"\"></p>\n<p>Ok so there is a score finally, not the best but it trained ! </p>",
              "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6915758%2F387a8ff0e75081b20ec4dd414bddebd4%2FScreen%20Shot%202023-05-08%20at%205.53.58.png?generation=1683514558138367&alt=media)\n\nOk so there is a score finally, not the best but it trained ! ",
              "votes": 1
            },
            {
              "id": 2249808,
              "postDate": "2023-05-08T06:09:30.040Z",
              "content": "<p>And leaderboard score is zero 😬</p>",
              "rawMarkdown": "And leaderboard score is zero 😬"
            },
            {
              "id": 2250131,
              "postDate": "2023-05-08T11:08:33.543Z",
              "content": "<p>No way. I guess the most important thing for this competition is how to split the data. </p>",
              "rawMarkdown": "No way. I guess the most important thing for this competition is how to split the data. "
            },
            {
              "id": 2250136,
              "postDate": "2023-05-08T11:13:01.960Z",
              "content": "<p>I validated on extracted charts only ! I need a day off I guess then I will revision what I did ! </p>",
              "rawMarkdown": "I validated on extracted charts only ! I need a day off I guess then I will revision what I did ! "
            },
            {
              "id": 2250370,
              "postDate": "2023-05-08T14:14:25.130Z",
              "content": "<p><a href=\"https://www.kaggle.com/asalhi\" target=\"_blank\">@asalhi</a> </p>\n<p>Scoring time was about 1 hour</p>",
              "rawMarkdown": "@asalhi \n\nScoring time was about 1 hour"
            },
            {
              "id": 2250558,
              "postDate": "2023-05-08T16:22:06.883Z",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> this is fast! My scoring takes 4 hours every time. I would learn about your solution after this ends.</p>",
              "rawMarkdown": "@nbroad this is fast! My scoring takes 4 hours every time. I would learn about your solution after this ends."
            },
            {
              "id": 2250576,
              "postDate": "2023-05-08T16:42:44.457Z",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> Check out if you're using correctly <code>eos_token_id</code> inside model.generate.</p>",
              "rawMarkdown": "@zhugds Check out if you're using correctly `eos_token_id` inside model.generate.",
              "votes": 2
            },
            {
              "id": 2250609,
              "postDate": "2023-05-08T17:12:44.387Z",
              "content": "<p>Can you please elaborate a bit?<br>\nHere is my code.</p>\n<pre><code>            output = model.generate(**inputs, \n                                    max_new_tokens=,\n                                    early_stopping=,\n                                    use_cache=,\n                                    pad_token_id=processor.tokenizer.pad_token_id,\n                                    eos_token_id=processor.tokenizer.eos_token_id,\n                                    ) \n</code></pre>\n<p>Thanks.</p>",
              "rawMarkdown": "Can you please elaborate a bit?\nHere is my code.\n```python\n            output = model.generate(**inputs, \n                                    max_new_tokens=1024,\n                                    early_stopping=True,\n                                    use_cache=True,\n                                    pad_token_id=processor.tokenizer.pad_token_id,\n                                    eos_token_id=processor.tokenizer.eos_token_id,\n                                    ) \n```\nThanks."
            },
            {
              "id": 2250668,
              "postDate": "2023-05-08T17:48:33.607Z",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> It depends, but maybe in training you are not using default <code>eos_token_id</code> from tokanizer (for example <code>&lt;/s&gt;</code> for Donut). Maybe in training your last token is for example <code>&lt;Y_END&gt;</code> than  eos_token_id should be <code>eos_token_id=processor.tokenizer.convert_tokens_to_ids([\"&lt;Y_END&gt;\"])[0]</code></p>",
              "rawMarkdown": "@zhugds It depends, but maybe in training you are not using default `eos_token_id` from tokanizer (for example `</s>` for Donut). Maybe in training your last token is for example `<Y_END>` than  eos_token_id should be `eos_token_id=processor.tokenizer.convert_tokens_to_ids([\"<Y_END>\"])[0]`",
              "votes": 1
            },
            {
              "id": 2250746,
              "postDate": "2023-05-08T18:45:18.237Z",
              "content": "<p>Thank you! I will double check my code to make sure I did that.</p>",
              "rawMarkdown": "Thank you! I will double check my code to make sure I did that."
            },
            {
              "id": 2250747,
              "postDate": "2023-05-08T18:45:37.563Z",
              "content": "<p>I set my max tokens to 512</p>",
              "rawMarkdown": "I set my max tokens to 512",
              "votes": 1
            },
            {
              "id": 2250891,
              "postDate": "2023-05-08T21:44:36.713Z",
              "content": "<p>I think I know why I am getting zero as a score, the batch_size was set to 16, which caused the model generator to throw an error (most likely due to out of memory exception), and this then defaulted to a zero value with default vertical bar --&gt; zero score, I fixed this and I just submitted my model for scoring, I will update with the results. </p>",
              "rawMarkdown": "I think I know why I am getting zero as a score, the batch_size was set to 16, which caused the model generator to throw an error (most likely due to out of memory exception), and this then defaulted to a zero value with default vertical bar --> zero score, I fixed this and I just submitted my model for scoring, I will update with the results. ",
              "votes": 1
            },
            {
              "id": 2250916,
              "postDate": "2023-05-08T22:47:38.543Z",
              "content": "<p>which pretrained model weights are you guys using?</p>",
              "rawMarkdown": "which pretrained model weights are you guys using?"
            },
            {
              "id": 2250942,
              "postDate": "2023-05-08T23:35:33.793Z",
              "content": "<p><a href=\"https://www.kaggle.com/alejopaullier\" target=\"_blank\">@alejopaullier</a> We are talking about pix2struct model. <a href=\"https://huggingface.co/google/pix2struct-base\" target=\"_blank\">https://huggingface.co/google/pix2struct-base</a><br>\nNicholas was actually talking about matcha</p>",
              "rawMarkdown": "@alejopaullier We are talking about pix2struct model. https://huggingface.co/google/pix2struct-base\nNicholas was actually talking about matcha",
              "votes": 1
            },
            {
              "id": 2251003,
              "postDate": "2023-05-09T01:27:59.327Z",
              "content": "<p>thanks <a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a>, I've tried training pix2struct base as an image encoder text decoder (but weirdly predicts always the same text). Matcha seems to require a question as it was trained as a VQA model so I wouldnt know how it can fit this competition's problem (e.g: which question should be asked to get data series)</p>",
              "rawMarkdown": "thanks @zhugds, I've tried training pix2struct base as an image encoder text decoder (but weirdly predicts always the same text). Matcha seems to require a question as it was trained as a VQA model so I wouldnt know how it can fit this competition's problem (e.g: which question should be asked to get data series)",
              "votes": 2
            },
            {
              "id": 2251029,
              "postDate": "2023-05-09T02:27:34.837Z",
              "content": "<p>If you predict the same text, that's what this thread is for. <br>\nTry <code>pip install git+https://github.com/huggingface/transformers.git</code> as Nicholas mentioned and it should work.</p>",
              "rawMarkdown": "If you predict the same text, that's what this thread is for. \nTry `pip install git+https://github.com/huggingface/transformers.git` as Nicholas mentioned and it should work."
            },
            {
              "id": 2251031,
              "postDate": "2023-05-09T02:30:07.463Z",
              "content": "<p>When you create the processor, you can turn vqa off</p>\n<p><code>processor = AutoProcessor.from_pretrained(\"google/matcha-base\", is_vqa=False)</code></p>",
              "rawMarkdown": "When you create the processor, you can turn vqa off\n\n`processor = AutoProcessor.from_pretrained(\"google/matcha-base\", is_vqa=False)`",
              "votes": 5
            },
            {
              "id": 2251454,
              "postDate": "2023-05-09T11:02:36.173Z",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a>, if you have some time could you kindly have a look at my submissions. I have been implementing many kind of checks for invalid values:</p>\n<ul>\n<li>check for empty string</li>\n<li>force convert every value to float to check if they become inf or nan</li>\n<li>remove ; from generated value</li>\n</ul>\n<p>And yet I keep having Submission Scoring Errors, maybe it's just some simple bug in my code but at this point I would appreciate very much an idea to continue debugging 😅.</p>",
              "rawMarkdown": "Hi @ryanholbrook, if you have some time could you kindly have a look at my submissions. I have been implementing many kind of checks for invalid values:\n- check for empty string\n- force convert every value to float to check if they become inf or nan\n- remove ; from generated value\n\nAnd yet I keep having Submission Scoring Errors, maybe it's just some simple bug in my code but at this point I would appreciate very much an idea to continue debugging 😅."
            },
            {
              "id": 2251502,
              "postDate": "2023-05-09T12:09:26.840Z",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/qdv206\" target=\"_blank\">@qdv206</a>, I'm seeing <code>ERROR: Record 1256 had 2 columns but expected 3</code>. Maybe you forgot to save the index?</p>",
              "rawMarkdown": "Hi @qdv206, I'm seeing `ERROR: Record 1256 had 2 columns but expected 3`. Maybe you forgot to save the index?",
              "votes": 2
            },
            {
              "id": 2251510,
              "postDate": "2023-05-09T12:25:38.073Z",
              "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> <br>\nThat's strange, on the submission generated from the dummy test set it shows 3 columns for me (I ran the notebook on 10000 images of the train set and the generated submission.csv is also 3 columns). Maybe my post processing caused a problem in a particular sample of the hidden test set.<br>\nThank you very much for your quick reply, it would have taken me a long time to consider this possibility. Now I know where to look 🙏.</p>",
              "rawMarkdown": "@ryanholbrook \nThat's strange, on the submission generated from the dummy test set it shows 3 columns for me (I ran the notebook on 10000 images of the train set and the generated submission.csv is also 3 columns). Maybe my post processing caused a problem in a particular sample of the hidden test set.\nThank you very much for your quick reply, it would have taken me a long time to consider this possibility. Now I know where to look 🙏.\n",
              "votes": 1
            },
            {
              "id": 2251781,
              "postDate": "2023-05-09T16:07:04.360Z",
              "content": "<p>Training error is between 0.4 to 0.2 (for 3 epochs), but generated strings are having repeated value or wrong values. how to handle this case?  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F761268%2Ff416f1d99b09bd36cac646a7847713c4%2FWB%20Chart%2009_05_2023%2021_31_46.png?generation=1683648143994535&amp;alt=media\" alt=\"\"></p>",
              "rawMarkdown": "Training error is between 0.4 to 0.2 (for 3 epochs), but generated strings are having repeated value or wrong values. how to handle this case?  ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F761268%2Ff416f1d99b09bd36cac646a7847713c4%2FWB%20Chart%2009_05_2023%2021_31_46.png?generation=1683648143994535&alt=media)"
            },
            {
              "id": 2251795,
              "postDate": "2023-05-09T16:22:54.427Z",
              "content": "<p>Use bf16 if you can.<br>\nMy learning rate was 3e-5.<br>\nI haven't tried using weight decay.<br>\nI didn't use a scheduler either</p>",
              "rawMarkdown": "Use bf16 if you can.\nMy learning rate was 3e-5.\nI haven't tried using weight decay.\nI didn't use a scheduler either",
              "votes": 2
            },
            {
              "id": 2251943,
              "postDate": "2023-05-09T18:52:58.133Z",
              "content": "<p>Looks like I need to start trying to figure out matcha! I joined the party a little late here, I was able to get my first donut to .46 and I have a second one submitting now but hard to believe it will be a good solution at the end of competition if so many are getting in the .7's already. Never used this so it should be interesting!  </p>",
              "rawMarkdown": "Looks like I need to start trying to figure out matcha! I joined the party a little late here, I was able to get my first donut to .46 and I have a second one submitting now but hard to believe it will be a good solution at the end of competition if so many are getting in the .7's already. Never used this so it should be interesting!  ",
              "votes": 1
            },
            {
              "id": 2253262,
              "postDate": "2023-05-10T04:28:29.603Z",
              "content": "<p>Updates regarding Training ,  I was able to train and infer with pix2struct and matcha , not high scores (0.51, 0.41)  but acceptable due the small training I did.</p>\n<p>Inference took at first about 8 hrs then I was able to decrease it to 2.5 hours (most likely I can decrease it more).</p>",
              "rawMarkdown": "Updates regarding Training ,  I was able to train and infer with pix2struct and matcha , not high scores (0.51, 0.41)  but acceptable due the small training I did.\n\nInference took at first about 8 hrs then I was able to decrease it to 2.5 hours (most likely I can decrease it more).\n",
              "votes": 3
            },
            {
              "id": 2253646,
              "postDate": "2023-05-10T11:21:10.367Z",
              "content": "<p>how did you decrease the scoring time?</p>",
              "rawMarkdown": "how did you decrease the scoring time?"
            },
            {
              "id": 2253822,
              "postDate": "2023-05-10T13:20:26.583Z",
              "content": "<p>I dropped the batching and looped over the test images one by one , this dropped the scoring time from 8 hours to 2.5 hours with same score ! </p>\n<blockquote>\n<pre><code> im  tqdm(images):\n    ids.append(im.stem)\n    :\n        output=pix2struct_predict(im, model.cuda(), processor, device)\n        \n        all_generations.append(output)\n    :\n        all_generations.append()\n</code></pre>\n</blockquote>",
              "rawMarkdown": "I dropped the batching and looped over the test images one by one , this dropped the scoring time from 8 hours to 2.5 hours with same score ! \n\n>```python\nfor im in tqdm(images):\n    ids.append(im.stem)\n    try:\n        output=pix2struct_predict(im, model.cuda(), processor, device)\n        #print(output)\n        all_generations.append(output)\n    except:\n        all_generations.append(\"\")\n```\n        ",
              "votes": 7
            },
            {
              "id": 2254634,
              "postDate": "2023-05-11T06:14:54.843Z",
              "content": "<p>Use a single GPU (P100) and fit the max batch size it can accommodate. It should be faster than 2.5 hours.</p>",
              "rawMarkdown": "Use a single GPU (P100) and fit the max batch size it can accommodate. It should be faster than 2.5 hours.",
              "votes": 1
            },
            {
              "id": 2262477,
              "postDate": "2023-05-17T01:26:14.270Z",
              "content": "<p>could anyone tell me around how many epochs have you train the model?</p>",
              "rawMarkdown": "could anyone tell me around how many epochs have you train the model?",
              "votes": 3
            },
            {
              "id": 2262486,
              "postDate": "2023-05-17T01:42:13.047Z",
              "content": "<p>I did 10 epochs</p>",
              "rawMarkdown": "I did 10 epochs",
              "votes": 4
            },
            {
              "id": 2262493,
              "postDate": "2023-05-17T01:50:26.977Z",
              "content": "<p>Did you do that with the full training dataset or some subset for the sake of time?</p>",
              "rawMarkdown": "Did you do that with the full training dataset or some subset for the sake of time?",
              "votes": 1
            },
            {
              "id": 2262544,
              "postDate": "2023-05-17T02:22:31.287Z",
              "content": "<p>Full data set </p>",
              "rawMarkdown": "Full data set ",
              "votes": 3
            },
            {
              "id": 2264953,
              "postDate": "2023-05-18T22:06:16.377Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2269105,
              "postDate": "2023-05-22T08:10:16.973Z",
              "content": "<p>Could you tell us more about this?</p>",
              "rawMarkdown": "Could you tell us more about this?"
            },
            {
              "id": 2277382,
              "postDate": "2023-05-27T17:06:10.810Z",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> What is the batch size used for training?</p>",
              "rawMarkdown": "Hi @nbroad What is the batch size used for training?",
              "votes": 1
            },
            {
              "id": 2277462,
              "postDate": "2023-05-27T19:27:14.253Z",
              "content": "<p>use whatever batch size your GPU can support. Use gradient checkpointing if you want a bigger one. <a href=\"https://github.com/google-research/tuning_playbook#choosing-the-batch-size\" target=\"_blank\">You should be able to get to the same point no matter what your batch size is.</a></p>",
              "rawMarkdown": "use whatever batch size your GPU can support. Use gradient checkpointing if you want a bigger one. [You should be able to get to the same point no matter what your batch size is.](https://github.com/google-research/tuning_playbook#choosing-the-batch-size)",
              "votes": 3
            },
            {
              "id": 2277812,
              "postDate": "2023-05-28T04:49:54.597Z",
              "content": "<p>I'm currently using matcha with the new transformers but my loss almost always stays near 6. No matter what I do I tried to change max_patches, fixed some bugs what I thought could've made it better.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7210035%2F8884a5cd22fbaca81756980066aa0c1f%2Floss.png?generation=1685249349864560&amp;alt=media\" alt=\"\"></p>\n<p>Any ideas what I could be doing wrong? Was there a major change you had to adopt when switching from donut to matcha?</p>",
              "rawMarkdown": "I'm currently using matcha with the new transformers but my loss almost always stays near 6. No matter what I do I tried to change max_patches, fixed some bugs what I thought could've made it better.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7210035%2F8884a5cd22fbaca81756980066aa0c1f%2Floss.png?generation=1685249349864560&alt=media)\n\nAny ideas what I could be doing wrong? Was there a major change you had to adopt when switching from donut to matcha?",
              "votes": 1
            },
            {
              "id": 2277887,
              "postDate": "2023-05-28T06:33:52.127Z",
              "content": "<p>Try formatting the text to be like how it was already trained, not like the format my donut notebook</p>\n<p>See the public deplot notebook for not details</p>",
              "rawMarkdown": "Try formatting the text to be like how it was already trained, not like the format my donut notebook\n\nSee the public deplot notebook for not details",
              "votes": 1
            },
            {
              "id": 2278236,
              "postDate": "2023-05-28T13:13:29.200Z",
              "content": "<blockquote>\n  <p>I dropped the batching and looped over the test images one by one , this dropped the scoring time from 8 hours to 2.5 hours with same score ! </p>\n  <blockquote>\n<pre><code> im  tqdm(images):\n    ids.append(im.stem)\n    :\n        output=pix2struct_predict(im, model.cuda(), processor, device)\n        \n        all_generations.append(output)\n    :\n        all_generations.append()\n</code></pre>\n  </blockquote>\n</blockquote>\n<p>Hi,<a href=\"https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/406250#2253822\" target=\"_blank\">@Ali Salhi</a> ,why is looping over the test images one by one faster than batching them? </p>",
              "rawMarkdown": "> I dropped the batching and looped over the test images one by one , this dropped the scoring time from 8 hours to 2.5 hours with same score ! \n> \n> >```python\n> for im in tqdm(images):\n>     ids.append(im.stem)\n>     try:\n>         output=pix2struct_predict(im, model.cuda(), processor, device)\n>         #print(output)\n>         all_generations.append(output)\n>     except:\n>         all_generations.append(\"\")\n> ```\n\nHi,[@Ali Salhi](https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/406250#2253822) ,why is looping over the test images one by one faster than batching them? "
            },
            {
              "id": 2278337,
              "postDate": "2023-05-28T15:35:55.733Z",
              "content": "<p>From my understanding I did as you said and the ground truth now looks like this </p>\n<p><code>TITLE | &lt;chart_title&gt; &lt;0x0A&gt; &lt;axis_title&gt; | &lt;axis_title&gt; &lt;0x0A&gt; y1 | x1 &lt;0x0A&gt; y2 | x2 &lt;0x0A&gt; y3 | x3 ...</code></p>\n<p>And now the loss bumps around 6.5 and 7. I also tried playing with other checkpoints besides base but they perform 2x worse.</p>\n<p>Edit: Nevermind I found a way to make it work, I removed spaces and changed the text inside the processor, I really had to dig in some discussions and notebooks. My matcha model is running fine with ~ &lt;1 loss but I don't think the loss is very stable, it often varies +- 0.4, is it maybe because I'm using scatterplots too?</p>",
              "rawMarkdown": "From my understanding I did as you said and the ground truth now looks like this \n\n```TITLE | <chart_title> <0x0A> <axis_title> | <axis_title> <0x0A> y1 | x1 <0x0A> y2 | x2 <0x0A> y3 | x3 ...```\n\nAnd now the loss bumps around 6.5 and 7. I also tried playing with other checkpoints besides base but they perform 2x worse.\n\nEdit: Nevermind I found a way to make it work, I removed spaces and changed the text inside the processor, I really had to dig in some discussions and notebooks. My matcha model is running fine with ~ <1 loss but I don't think the loss is very stable, it often varies +- 0.4, is it maybe because I'm using scatterplots too?",
              "votes": 1
            },
            {
              "id": 2278869,
              "postDate": "2023-05-29T03:29:08.223Z",
              "content": "<p>Hi,@<a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">nbroad</a>,there are 6 checkpoints are available for MatCha. Why did you choose matcha-base for training? It seems that plotqa-v1 or plotqa-v2 is more suitable for the current task.</p>",
              "rawMarkdown": "Hi,@[nbroad](https://www.kaggle.com/nbroad),there are 6 checkpoints are available for MatCha. Why did you choose matcha-base for training? It seems that plotqa-v1 or plotqa-v2 is more suitable for the current task.",
              "votes": 1
            },
            {
              "id": 2278872,
              "postDate": "2023-05-29T03:36:59.847Z",
              "content": "<p>I think the default task for matcha-base is more similar to this competition than plotqa. I didn't try the other ones, so this is just a hunch.</p>",
              "rawMarkdown": "I think the default task for matcha-base is more similar to this competition than plotqa. I didn't try the other ones, so this is just a hunch.",
              "votes": 1
            },
            {
              "id": 2279318,
              "postDate": "2023-05-29T09:12:36.430Z",
              "content": "<p>Hi,<a href=\"https://www.kaggle.com/chaitanyagiri\" target=\"_blank\">@chaitanyagiri</a>,thank you for sharing your experience<br>\nMy loss is also around 6, and I wonder how did you solve it? What does ‘emoved spaces and changed the text inside the processor’ mean? </p>",
              "rawMarkdown": "Hi,[@chaitanyagiri](https://www.kaggle.com/chaitanyagiri),thank you for sharing your experience\nMy loss is also around 6, and I wonder how did you solve it? What does ‘emoved spaces and changed the text inside the processor’ mean? "
            },
            {
              "id": 2280593,
              "postDate": "2023-05-30T07:49:03.203Z",
              "content": "<blockquote>\n  <p>use whatever batch size your GPU can support. Use gradient checkpointing if you want a bigger one. <a href=\"https://github.com/google-research/tuning_playbook#choosing-the-batch-size\" target=\"_blank\">You should be able to get to the same point no matter what your batch size is.</a></p>\n</blockquote>\n<p>Hi,<a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a>,when i used gradient checkpointing with the following code,an error popped up<br>\n<code>model = Pix2StructForConditionalGeneration.from_pretrained(Config['MODEL_NAME'])\nmodel.gradient_checkpointing_enable()</code><br>\n<code>ValueError: Pix2StructForConditionalGeneration does not support gradient checkpointing.</code><br>\nMay I ask if there is an error in my code?</p>",
              "rawMarkdown": "> use whatever batch size your GPU can support. Use gradient checkpointing if you want a bigger one. [You should be able to get to the same point no matter what your batch size is.](https://github.com/google-research/tuning_playbook#choosing-the-batch-size)\n\nHi,[@nbroad](https://www.kaggle.com/nbroad),when i used gradient checkpointing with the following code,an error popped up\n`model = Pix2StructForConditionalGeneration.from_pretrained(Config['MODEL_NAME'])\nmodel.gradient_checkpointing_enable()`\n`ValueError: Pix2StructForConditionalGeneration does not support gradient checkpointing.`\nMay I ask if there is an error in my code?\n"
            },
            {
              "id": 2280800,
              "postDate": "2023-05-30T11:10:57.833Z",
              "content": "<p><a href=\"https://www.kaggle.com/areno9516\" target=\"_blank\">@areno9516</a> Look at the deplot public notebook and see the Pix2StructProcessor call. You may have to change the text inside that particular call. Check <a href=\"https://www.kaggle.com/evilpsycho42\" target=\"_blank\">@evilpsycho42</a> 's comment on this thread.</p>",
              "rawMarkdown": "@areno9516 Look at the deplot public notebook and see the Pix2StructProcessor call. You may have to change the text inside that particular call. Check @evilpsycho42 's comment on this thread.",
              "votes": 1
            },
            {
              "id": 2283659,
              "postDate": "2023-06-01T12:26:39.243Z",
              "content": "<p>I am training the pix2struct model. The loss is decreasing normally but eventually stabilizes around 0.7, while I see that your training loss stabilizes around 0.3+. Moreover, when I used sample test images for prediction, the results seemed to be very bad. What could be the possible reasons for this?<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2382612%2F66b760cb4545b6f703bf294ff138fc83%2Floss.png?generation=1685622383943646&amp;alt=media\" alt=\"loss\"></p>",
              "rawMarkdown": "I am training the pix2struct model. The loss is decreasing normally but eventually stabilizes around 0.7, while I see that your training loss stabilizes around 0.3+. Moreover, when I used sample test images for prediction, the results seemed to be very bad. What could be the possible reasons for this?\n![loss](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2382612%2F66b760cb4545b6f703bf294ff138fc83%2Floss.png?generation=1685622383943646&alt=media)"
            },
            {
              "id": 2283724,
              "postDate": "2023-06-01T13:08:00.167Z",
              "content": "<p>Hi,<a href=\"https://www.kaggle.com/marbury\" target=\"_blank\">@marbury</a>,when calculating loss, you can ignore padding tokens. After I ignored the padding tokens, the loss has decreased significantly, which may be useful for you. By the way, my model suffered unstable losses during training, and I would like to ask if you have encountered such a situation.</p>",
              "rawMarkdown": "Hi,[@marbury](https://www.kaggle.com/marbury),when calculating loss, you can ignore padding tokens. After I ignored the padding tokens, the loss has decreased significantly, which may be useful for you. By the way, my model suffered unstable losses during training, and I would like to ask if you have encountered such a situation.\n\n"
            },
            {
              "id": 2283985,
              "postDate": "2023-06-01T16:36:57.607Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2283986,
              "postDate": "2023-06-01T16:37:52.233Z",
              "content": "<p>Try this: config.gradient checkpointing=True or model.config.gradient checkpointing=True, I didn't notice much difference. It's possible that I just don't understand something.</p>",
              "rawMarkdown": "Try this: config.gradient checkpointing=True or model.config.gradient checkpointing=True, I didn't notice much difference. It's possible that I just don't understand something.",
              "votes": 1
            },
            {
              "id": 2284001,
              "postDate": "2023-06-01T16:52:02.783Z",
              "content": "<p><a href=\"https://www.kaggle.com/areno9516\" target=\"_blank\">@areno9516</a> </p>\n<p>model.encoder.gradient_checkpointing_enable()</p>\n<p>model.decoder.gradient_checkpointing_enable()</p>",
              "rawMarkdown": "@areno9516 \n\nmodel.encoder.gradient_checkpointing_enable()\n\nmodel.decoder.gradient_checkpointing_enable()",
              "votes": 2
            },
            {
              "id": 2284006,
              "postDate": "2023-06-01T16:58:54.717Z",
              "content": "<p><a href=\"https://www.kaggle.com/areno9516\" target=\"_blank\">@areno9516</a> <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> Do I need to modify the source code in pix2struct transformers to ignore padding tokens when calculate the loss?</p>\n<p>It seems that they have already done this in transformers.</p>\n<pre><code> labels   :\n            \n            labels = labels.to(logits.device)\n            loss_fct = nn.CrossEntropyLoss(ignore_index=-, reduction=)\n</code></pre>",
              "rawMarkdown": "@areno9516 @nbroad Do I need to modify the source code in pix2struct transformers to ignore padding tokens when calculate the loss?\n\nIt seems that they have already done this in transformers.\n```python\nif labels is not None:\n            # move labels to correct device to enable model parallelism\n            labels = labels.to(logits.device)\n            loss_fct = nn.CrossEntropyLoss(ignore_index=-100, reduction=\"mean\")\n```",
              "votes": 1
            },
            {
              "id": 2284127,
              "postDate": "2023-06-01T18:33:33.270Z",
              "content": "<p>You need to set the labels to be -100 to get ignored</p>",
              "rawMarkdown": "You need to set the labels to be -100 to get ignored",
              "votes": 1
            },
            {
              "id": 2284596,
              "postDate": "2023-06-02T07:01:37.843Z",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> Thanks, I have set the pad_token_id to -100 as you do in your public notebook. However, the loss is still not decreased as expected.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2382612%2Fc6dbb72435ecfc3709e3b8b21513f2f4%2Floss.png?generation=1685689292833465&amp;alt=media\" alt=\"\"></p>",
              "rawMarkdown": "@nbroad Thanks, I have set the pad_token_id to -100 as you do in your public notebook. However, the loss is still not decreased as expected.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2382612%2Fc6dbb72435ecfc3709e3b8b21513f2f4%2Floss.png?generation=1685689292833465&alt=media)"
            },
            {
              "id": 2284918,
              "postDate": "2023-06-02T10:54:16.630Z",
              "content": "<blockquote>\n  <p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>\n</blockquote>\n<p>Do you include the scatter plot images for training in this train loss?</p>",
              "rawMarkdown": "> ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&alt=media)\n\nDo you include the scatter plot images for training in this train loss?"
            },
            {
              "id": 2294656,
              "postDate": "2023-06-10T07:54:12.500Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2294660,
              "postDate": "2023-06-10T07:57:35.320Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2294663,
              "postDate": "2023-06-10T07:59:45.023Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2294665,
              "postDate": "2023-06-10T08:00:44.943Z",
              "content": "<p>Hi, I was wondering what else have you done besides this method to reduce the scoring time, since my current scoring time is so long that it takes 6 hours</p>",
              "rawMarkdown": "Hi, I was wondering what else have you done besides this method to reduce the scoring time, since my current scoring time is so long that it takes 6 hours"
            },
            {
              "id": 2295823,
              "postDate": "2023-06-11T09:30:42.597Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 2295824,
              "postDate": "2023-06-11T09:31:27.853Z",
              "content": "<p>Did you pre-train the model using matcha-plotqa-v2? Is the training labeled xxxyyy or xyxy? The loss never goes down</p>",
              "rawMarkdown": "Did you pre-train the model using matcha-plotqa-v2? Is the training labeled xxxyyy or xyxy? The loss never goes down",
              "votes": 1
            },
            {
              "id": 2301417,
              "postDate": "2023-06-13T22:40:45.200Z",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/areno\" target=\"_blank\">@areno</a>, I see that you mentioned you had an unstable loss. Do you still have it? If not may I ask what was your workaround for that?</p>",
              "rawMarkdown": "Hi @areno, I see that you mentioned you had an unstable loss. Do you still have it? If not may I ask what was your workaround for that?"
            },
            {
              "id": 2301552,
              "postDate": "2023-06-14T02:40:46.680Z",
              "content": "<p>Hi,<a href=\"https://www.kaggle.com/chaitanyagiri\" target=\"_blank\">@chaitanyagiri</a><br>\nYou may be able to ignore that. My loss was unstable, with an average value of about 0.2, but fluctuating between 0.05 and 0.6.And the model finally got 0.75 cv and 0.68 lb </p>",
              "rawMarkdown": "Hi,[@chaitanyagiri](https://www.kaggle.com/chaitanyagiri)\nYou may be able to ignore that. My loss was unstable, with an average value of about 0.2, but fluctuating between 0.05 and 0.6.And the model finally got 0.75 cv and 0.68 lb ",
              "votes": 1
            },
            {
              "id": 2301761,
              "postDate": "2023-06-14T06:39:32.890Z",
              "content": "<p>My loss fluctuates between 0.8 and 0 and the average is 0.35. I tried increasing lr but it's still the same. I'm using deplot, what about you?</p>",
              "rawMarkdown": "My loss fluctuates between 0.8 and 0 and the average is 0.35. I tried increasing lr but it's still the same. I'm using deplot, what about you?",
              "votes": 1
            },
            {
              "id": 2301802,
              "postDate": "2023-06-14T07:10:17.780Z",
              "content": "<blockquote>\n  <p>My loss fluctuates between 0.8 and 0 and the average is 0.35. I tried increasing lr but it's still the same. I'm using deplot, what about you?</p>\n</blockquote>\n<p>I have tried the Matcha and Deplot models.Their losses are close and Matcha‘s scores are slightly better. My Learning rate is 3e-5</p>",
              "rawMarkdown": "> My loss fluctuates between 0.8 and 0 and the average is 0.35. I tried increasing lr but it's still the same. I'm using deplot, what about you?\n\nI have tried the Matcha and Deplot models.Their losses are close and Matcha‘s scores are slightly better. My Learning rate is 3e-5\n",
              "votes": 1
            },
            {
              "id": 2302497,
              "postDate": "2023-06-14T15:29:06.357Z",
              "content": "<p>And do you use the competition's dataset or the 500k images one?</p>",
              "rawMarkdown": "And do you use the competition's dataset or the 500k images one?"
            },
            {
              "id": 2302974,
              "postDate": "2023-06-15T02:10:02.057Z",
              "content": "<blockquote>\n  <p>And do you use the competition's dataset or the 500k images one?</p>\n</blockquote>\n<p>I used the competition's dataset and 100k images of 500k images</p>",
              "rawMarkdown": "> And do you use the competition's dataset or the 500k images one?\n\nI used the competition's dataset and 100k images of 500k images"
            },
            {
              "id": 2303350,
              "postDate": "2023-06-15T08:58:33.680Z",
              "content": "<p>So the 100k images were of scatterplots or stratified the images like 20k from each. And how many epochs do you train for? I kinda notice that my losses doesn't seem to go down after the 2nd</p>",
              "rawMarkdown": "So the 100k images were of scatterplots or stratified the images like 20k from each. And how many epochs do you train for? I kinda notice that my losses doesn't seem to go down after the 2nd"
            },
            {
              "id": 2304446,
              "postDate": "2023-06-16T02:16:03.080Z",
              "content": "<blockquote>\n  <p>So the 100k images were of scatterplots or stratified the images like 20k from each. And how many epochs do you train for? I kinda notice that my losses doesn't seem to go down after the 2nd</p>\n</blockquote>\n<p>20k for each type of chart. I trained three epochs. Maybe you can try a smaller lr</p>",
              "rawMarkdown": "> So the 100k images were of scatterplots or stratified the images like 20k from each. And how many epochs do you train for? I kinda notice that my losses doesn't seem to go down after the 2nd\n\n20k for each type of chart. I trained three epochs. Maybe you can try a smaller lr\n",
              "votes": 1
            }
          ]
        },
        {
          "id": 2271435,
          "postDate": "2023-05-23T22:29:06.937Z",
          "content": "<p>Thanks everyone for sharing. I have learnt a lot from this discussion.</p>\n<p></p>\n<p></p>\n<p></p>\n<p>Update: I had max patches set to 4.. </p>",
          "rawMarkdown": "Thanks everyone for sharing. I have learnt a lot from this discussion.\n\n~~After training for 2 epochs, my model just generates a text sequence with a year then float format. Something like this.~~\n\n~~`1949.1 | 100.1 <0x0A> 1950.1 | 100.3 <0x0A> 1952.1 | 100.3 <0x0A> 1954.1 |`...~~\n\n~~I installed from source and tried all the recommendations in this thread. Did anyone else run into this issue?~~\n\nUpdate: I had max patches set to 4.. ",
          "votes": 1
        }
      ]
    },
    {
      "id": 2306839,
      "postDate": "2023-06-17T16:16:25.600Z",
      "content": "<p>Is there a public code/notebook that is best to use for Matcha model? </p>\n<p>Thanks.</p>",
      "rawMarkdown": "Is there a public code/notebook that is best to use for Matcha model? \n\nThanks.\n\n\n"
    },
    {
      "id": 2254461,
      "postDate": "2023-05-11T02:36:24.667Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2300948,
      "author_name": "Vladimir Simões da Luz Junior",
      "author_url": "",
      "post_date": "2023-06-13T14:27:14.523000",
      "content": "<p>Thanks for sharing <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> !</p>\n<p>Have you tired inference with Pix2Struct, MatCha or DePlot? If so were the results reasonable?</p>\n<p>Keep up with the great work🔥💪</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2301462,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2023-06-14T00:59:25.973000",
          "content": "<p>My current score 0.65 is using matcha</p>",
          "votes": 2,
          "replies": [
            {
              "id": 2301651,
              "author_name": "Cody_Null",
              "author_url": "",
              "post_date": "2023-06-14T04:39:49.860000",
              "content": "<p>We are using Matcha for our submission as well. Hyperparameter tuning is a massive pain but it can bring good scores</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2309834,
              "author_name": "Vladimir Simões da Luz Junior",
              "author_url": "",
              "post_date": "2023-06-19T23:28:39.023000",
              "content": "<p>Really interesting, <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> <a href=\"https://www.kaggle.com/cody11null\" target=\"_blank\">@cody11null</a> ! </p>\n<p>I have been playing out with DePlot, but have not explored Matcha yet…. Curious to see how you guys approached this challenge!</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2280277,
      "author_name": "KKY",
      "author_url": "",
      "post_date": "2023-05-30T02:40:18.673000",
      "content": "<p>Thanks for your sharing!  <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> </p>\n<p>tried matcha models &amp; pix2struct,  only got highest 0.6 cv in local.</p>\n<ul>\n<li>lr 4e-5</li>\n<li>epochs 2</li>\n<li>batch size 2</li>\n<li>Adam</li>\n<li>no prompt</li>\n</ul>\n<p>do you pass any prompts to model?  (just like deplot inputs = processor(images=image, text=\"Generate underlying data table of the figure below:\", return_tensors=\"pt\"))</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2301652,
          "author_name": "Cody_Null",
          "author_url": "",
          "post_date": "2023-06-14T04:40:32.450000",
          "content": "<p>You should be able to do more than 2 epochs, though I am surprised that 2 only bring .6 CV</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2305356,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-06-16T16:11:45.253000",
          "content": "",
          "votes": 1,
          "replies": [
            {
              "id": 2305359,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-06-16T16:14:28.647000",
              "content": "",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2273592,
      "author_name": "HZM",
      "author_url": "",
      "post_date": "2023-05-25T09:03:46.760000",
      "content": "<p>may I know your MatCha inference  speed, my model inference is too slow and always time out.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2273890,
          "author_name": "Cody_Null",
          "author_url": "",
          "post_date": "2023-05-25T13:39:45.480000",
          "content": "<p>My training is taking close to 7 hours and my inference on LB is about 2.5 hours I believe. </p>",
          "votes": 3,
          "replies": [
            {
              "id": 2279763,
              "author_name": "moth",
              "author_url": "",
              "post_date": "2023-05-29T15:53:57.110000",
              "content": "<p>training is 6.5 hours, inference is about 2 hours</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2281613,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-05-31T03:10:05.127000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2283762,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-06-01T13:35:55.540000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2285235,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-06-02T14:49:52.543000",
              "content": "<p>Really? Shouldn't deplot be a better option since it is fine-tuned on matcha itself and it specifically trained for plot-to-table?</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2265780,
      "author_name": "pksamantaray",
      "author_url": "",
      "post_date": "2023-05-19T14:01:40.427000",
      "content": "<p>how will you download as the submission is without the internet?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2265819,
          "author_name": "Bartley",
          "author_url": "",
          "post_date": "2023-05-19T14:29:35.510000",
          "content": "<p>There is a good discussion <a href=\"https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/410130\" target=\"_blank\">here</a> that shows how to do this.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2300943,
              "author_name": "Vladimir Simões da Luz Junior",
              "author_url": "",
              "post_date": "2023-06-13T14:23:42.070000",
              "content": "<p>Thanks for sharing <a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> !</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2255915,
      "author_name": "jiayoufan666",
      "author_url": "",
      "post_date": "2023-05-12T05:18:37.637000",
      "content": "<p>Hi Nicholas, did you try to submit a notebook that uses the DePlot model? I found that the model is trying to download something from the Internet and this will cause the run to fail. Did you figure out a way to solve this problem? </p>",
      "votes": 1,
      "replies": [
        {
          "id": 2257019,
          "author_name": "sinchir0",
          "author_url": "",
          "post_date": "2023-05-12T23:40:53.747000",
          "content": "<p>deplot downloads the font file with the following code</p>\n<p><a href=\"https://github.com/huggingface/transformers/blob/cf11493dce0a1d22446efe0d6c4ade02fd928e50/src/transformers/models/pix2struct/image\" target=\"_blank\">https://github.com/huggingface/transformers/blob/cf11493dce0a1d22446efe0d6c4ade02fd928e50/src/transformers/models/pix2struct/image</a> _processing_pix2struct.py#L129</p>\n<p>Here is the file that is being loaded.<br>\n<a href=\"https://huggingface.co/ybelkada/fonts\" target=\"_blank\">https://huggingface.co/ybelkada/fonts</a></p>\n<p>If you upload the above file to Datasets, you can use it on Internet Off.</p>",
          "votes": 3,
          "replies": [
            {
              "id": 2302774,
              "author_name": "zj yang",
              "author_url": "",
              "post_date": "2023-06-14T19:21:14.370000",
              "content": "<p>thank you!! I spend an hour attempting to fix the bug…</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2302911,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-06-15T00:46:58.257000",
              "content": "<p>You can pass the path to the file when you call the processor. </p>\n<p><code>processor(images=images, text=text, font_path=\"path/to/Arial.TTF\")</code></p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 2262147,
          "author_name": "asarvazyan",
          "author_url": "",
          "post_date": "2023-05-16T18:54:02.057000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/jiayoufan666\" target=\"_blank\">@jiayoufan666</a> if you use <code>Pix2StructProcessor.from_pretrained(..., is_vqa=False)</code> it will not load the font since it doesn't need to call the <code>render_header</code> method when preprocessing, which includes the part of code that downloads the .TTF file.</p>",
          "votes": 4,
          "replies": [
            {
              "id": 2270753,
              "author_name": "pksamantaray",
              "author_url": "",
              "post_date": "2023-05-23T11:35:12.227000",
              "content": "<p>Hi Sarvazyan, Could you give some hints regarding the training using Pix2StructProcessor.from_pretrained().</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2277461,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-27T19:25:20.553000",
              "content": "<p><a href=\"https://www.kaggle.com/pksamantaray\" target=\"_blank\">@pksamantaray</a> , <a href=\"https://www.kaggle.com/code/heyytanay/training-pix2struct-pytorch-amp-w-b\" target=\"_blank\">this notebook</a> shows how to train pix2struct/matcha/deplot models</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2241852,
      "author_name": "june",
      "author_url": "",
      "post_date": "2023-05-01T21:50:59.397000",
      "content": "<p>Thanks for sharing. Have you tried it yet?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2241941,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2023-05-02T01:03:22.660000",
          "content": "<p>Yes. It works</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2242142,
      "author_name": "Homoalways",
      "author_url": "",
      "post_date": "2023-05-02T04:09:15.427000",
      "content": "<p>Thanks. Do these models work better than donut?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2242154,
          "author_name": "Nicholas Broad",
          "author_url": "",
          "post_date": "2023-05-02T04:26:21.837000",
          "content": "<p>Yes, my donut approach CV was about 0.44 and my CV for matcha was close to 0.7. I didn't submit for matcha, but my leaderboard score for donut was very close to the CV.</p>",
          "votes": 4,
          "replies": [
            {
              "id": 2243684,
              "author_name": "Leon",
              "author_url": "",
              "post_date": "2023-05-03T04:57:06.707000",
              "content": "<p>How about your training loss after fixing the bug? Mine was very close to 0 but only scored 0.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2243701,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-03T05:28:27.360000",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2243727,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-03T05:48:45.697000",
              "content": "<p>I am trying to train deplot/ matcha with or without the fix (The latest version seems to have some of the bugs fixed , I've checked the source code) </p>\n<p>However the loss starts around 30 goes down to near 1  (once it hit almost 0.9 ) but also with very bad results ! <br>\nStill I think there is something wrong ! </p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2243728,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-03T05:49:58.990000",
              "content": "<p>In my strategy , I pretty much sure I have a puzzle piece missing</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2244306,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-03T15:05:05.537000",
              "content": "<p>Try installing from source <code>pip install git+https://github.com/huggingface/transformers.git</code></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2244843,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-03T23:21:24.073000",
              "content": "<blockquote>\n  <p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>\n</blockquote>\n<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> Will you plan to submit your new model? I am curious about how it performs on the test dataset.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2244954,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-04T03:28:08.567000",
              "content": "<p>Sure I can submit</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2245835,
              "author_name": "SeshuRaju 🧘‍♂️",
              "author_url": "",
              "post_date": "2023-05-04T16:18:37.360000",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> is it 800x2 = 1600 data points or 3/4 data?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2246047,
              "author_name": "moth",
              "author_url": "",
              "post_date": "2023-05-04T19:47:30.837000",
              "content": "<p><a href=\"https://www.kaggle.com/asalhi\" target=\"_blank\">@asalhi</a> same here, tried training pix2struct for a couple of epochs, loss went ~1.0 and when checking the generated texts it was always outputting nearly the same text.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2246051,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-04T19:54:47.207000",
              "content": "<p><a href=\"https://www.kaggle.com/seshurajup\" target=\"_blank\">@seshurajup</a>, what are you referring to?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246124,
              "author_name": "SeshuRaju 🧘‍♂️",
              "author_url": "",
              "post_date": "2023-05-04T22:32:29.383000",
              "content": "<p>i mean from the training loss <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2246126,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-04T22:39:33.273000",
              "content": "<p>Ah. I trained on all data except for scatter plots because the model does poorly on that anyway and I wanted it to go faster. </p>\n<p>The step corresponds to the logging step which was 100 times per epoch</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2246229,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-05-05T02:14:24.577000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246231,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-05T02:18:06.753000",
              "content": "<p>Try using bf16</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246246,
              "author_name": "Leon",
              "author_url": "",
              "post_date": "2023-05-05T02:34:38.347000",
              "content": "<p>Thank you. I will try it.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246363,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-05T05:11:42.507000",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> </p>\n<p>I keep getting submission errors (submission file is in the wrong format) when I submit 😔</p>\n<p>The model outputs on a subset of the training data and on the test set look good though</p>\n<p>Maybe <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> can kindly offer some suggestions for what is going wrong 🙏<br>\nIt's probably something silly 😅</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246661,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-05T11:01:09.057000",
              "content": "<p>😣 This happens a lot to me. 80% of my submissions threw exceptions. <br>\nThe line chart is extremely hard to predict because the number of points is not consistent with the number of x values while it should be. Otherwise, no one knows how many points are in tin the graph.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246762,
              "author_name": "Ryan Holbrook",
              "author_url": "",
              "post_date": "2023-05-05T12:48:50.767000",
              "content": "<p>Sorry to hear you're having trouble. I'll try to take a look if I can find some time. (Not trivial to look it up, unfortunately.) For now, I might suggest trying to validate the actual data type based on the predicted chart type. If the chart type implies that the values should be numeric, make sure the values can actually be parsed as numbers. Maybe something like: <code>try: float(x); except: 0.0</code>.</p>\n<p>Since dot plots can be ambiguous, maybe default to numeric on those since numeric can also pass as a string. Unfortunately, dot plots aren't as well represented in the training data which might be why it's passing there but not on submission if that's the culprit.</p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2246771,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-05-05T12:59:18.733000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246957,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-05T15:10:02.590000",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> <br>\nIt looks like models are supposed to choose coordinates corresponding to tick marks on the x-axis for line plots, even though it looks like there are infinite points for some of them.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2246958,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-05T15:11:43.343000",
              "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> ,</p>\n<p>1) don't worry about looking it up. I'm 95% sure it's a data type issue</p>\n<p>2) I thought <a href=\"https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/398528\" target=\"_blank\">this thread</a> confirmed that the data type didn't matter. If it didn't match, it would just get a score of 0</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2246960,
              "author_name": "Raja Biswas",
              "author_url": "",
              "post_date": "2023-05-05T15:13:40.637000",
              "content": "<p>Yes, from graph conventions:</p>\n<ul>\n<li>Categorical values always correspond to a tick label on an axis.</li>\n<li>Line graphs always have categorical x-axis values and numeric y-axis values</li>\n<li>The values for the x-axis are the x-axis tick labels beneath some portion of the line graph</li>\n</ul>\n<p>I think annotations are consistent, specially for extracted subset.</p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2246973,
              "author_name": "Ryan Holbrook",
              "author_url": "",
              "post_date": "2023-05-05T15:27:15.337000",
              "content": "<p>I thought it shouldn't… I'll take a look again.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2247313,
              "author_name": "Ryan Holbrook",
              "author_url": "",
              "post_date": "2023-05-05T21:39:49.887000",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> The error I'm seeing is <code>Submission had an invalid score. Please check your input data for numerical errors (e.g. \"NaN\", division by zero, etc)</code>.</p>\n<p>This actually looks like it's not a data type problem, which would have given a different error (an <code>Evaluation Exception</code>). I'm thinking the metric is processing the submission okay, but the leaderboard is rejecting it for some reason.</p>\n<p>Some things to check:</p>\n<ul>\n<li>all numbers are finite (not inf or nan)</li>\n<li>strings are non-empty</li>\n<li>numeric predictions are non-constant</li>\n</ul>\n<p>I tested the metric for robustness to the last two, but it couldn't hurt. (Those conditions are never true of the ground truth.)</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2247329,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-05T21:59:21.290000",
              "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a>,</p>\n<p>This is very helpful. I didn't consider the possibility of outputting inf or nan. </p>\n<p>For number 2, would the following data series create an error?</p>\n<p>\"0;1;;2;3\"</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2248122,
              "author_name": "Ryan Holbrook",
              "author_url": "",
              "post_date": "2023-05-06T14:01:30.307000",
              "content": "<p>I don't <em>think</em> so. I tested the metric with entries like <code>;;;</code> and the Levenshtein metric just treated them as empty strings as it should. My guess is that the first case (inf or nan) is most likely.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2248439,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-06T21:06:51.197000",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> </p>\n<p>I finally got a submission to work. I think it might have predicted something like 13e888 which would turn into inf when converted to a float. </p>\n<p>My score is 0.65 which matches CV (0.68) pretty close</p>",
              "votes": 8,
              "replies": []
            },
            {
              "id": 2248448,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-06T21:16:06.757000",
              "content": "<p>Great score<br>\nI am still trying to train deplot, loss is crazy no matter what I do.</p>\n<p>But I will keep digging till I see what I am missing .</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2248464,
              "author_name": "SeshuRaju 🧘‍♂️",
              "author_url": "",
              "post_date": "2023-05-06T21:33:36.177000",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> are you eliminate Inf/nan is the solution for the successful submission ? Nice to see CV is sable !!</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2248470,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-06T21:47:15.777000",
              "content": "<p>I think I wasn't directly outputting inf or nan, but when the float conversion happened, it turned into inf (e.g. float(3e999))</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2248482,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-06T22:23:59.897000",
              "content": "<p>Awesome! I haven't made it work yet. Not sure what's wrong. <br>\nLocal validation is good, but not for the leaderboard.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2249553,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-07T20:48:20.577000",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> It's so weird that my local validation score is 0.6+, but my submission score is 0.42. I split the images 80/20 for training and validation. Do you know what could go wrong? <br>\nMy initial thought was that the private testing images are different from training images, which was clearly wrong from your case.<br>\n<a href=\"https://www.kaggle.com/asalhi\" target=\"_blank\">@asalhi</a> Does pix2struct work for you? </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2249562,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-07T21:04:09.333000",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> <br>\nThe test set is only extracted images. You might be overfitting to generated images</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2249566,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-07T21:21:22.863000",
              "content": "<p>Thanks for the tip. That just came to my mind. Did you split the images as you did in the donut training?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2249683,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-08T02:37:58.450000",
              "content": "<p>I think I was able to train matcha ! , it just finished the trainning with loss chart similar to <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> , I tested on solo images and it seems to generate a nice output ! and I directly moved the weights to Kaggle, I am validating now but it seems that it takes a good amount of time to validate ! <br>\n<a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> can you verify the scoring time ? I guess it will be near 9 hours (unless I play with max_length) ? </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2249686,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-08T02:56:35.330000",
              "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6915758%2F387a8ff0e75081b20ec4dd414bddebd4%2FScreen%20Shot%202023-05-08%20at%205.53.58.png?generation=1683514558138367&amp;alt=media\" alt=\"\"></p>\n<p>Ok so there is a score finally, not the best but it trained ! </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2249808,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-08T06:09:30.040000",
              "content": "<p>And leaderboard score is zero 😬</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250131,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-08T11:08:33.543000",
              "content": "<p>No way. I guess the most important thing for this competition is how to split the data. </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250136,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-08T11:13:01.960000",
              "content": "<p>I validated on extracted charts only ! I need a day off I guess then I will revision what I did ! </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250370,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-08T14:14:25.130000",
              "content": "<p><a href=\"https://www.kaggle.com/asalhi\" target=\"_blank\">@asalhi</a> </p>\n<p>Scoring time was about 1 hour</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250558,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-08T16:22:06.883000",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> this is fast! My scoring takes 4 hours every time. I would learn about your solution after this ends.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250576,
              "author_name": "Roman Khomenko",
              "author_url": "",
              "post_date": "2023-05-08T16:42:44.457000",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> Check out if you're using correctly <code>eos_token_id</code> inside model.generate.</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2250609,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-08T17:12:44.387000",
              "content": "<p>Can you please elaborate a bit?<br>\nHere is my code.</p>\n<pre><code>            output = model.generate(**inputs, \n                                    max_new_tokens=,\n                                    early_stopping=,\n                                    use_cache=,\n                                    pad_token_id=processor.tokenizer.pad_token_id,\n                                    eos_token_id=processor.tokenizer.eos_token_id,\n                                    ) \n</code></pre>\n<p>Thanks.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250668,
              "author_name": "Roman Khomenko",
              "author_url": "",
              "post_date": "2023-05-08T17:48:33.607000",
              "content": "<p><a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a> It depends, but maybe in training you are not using default <code>eos_token_id</code> from tokanizer (for example <code>&lt;/s&gt;</code> for Donut). Maybe in training your last token is for example <code>&lt;Y_END&gt;</code> than  eos_token_id should be <code>eos_token_id=processor.tokenizer.convert_tokens_to_ids([\"&lt;Y_END&gt;\"])[0]</code></p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2250746,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-08T18:45:18.237000",
              "content": "<p>Thank you! I will double check my code to make sure I did that.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250747,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-08T18:45:37.563000",
              "content": "<p>I set my max tokens to 512</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2250891,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-08T21:44:36.713000",
              "content": "<p>I think I know why I am getting zero as a score, the batch_size was set to 16, which caused the model generator to throw an error (most likely due to out of memory exception), and this then defaulted to a zero value with default vertical bar --&gt; zero score, I fixed this and I just submitted my model for scoring, I will update with the results. </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2250916,
              "author_name": "moth",
              "author_url": "",
              "post_date": "2023-05-08T22:47:38.543000",
              "content": "<p>which pretrained model weights are you guys using?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2250942,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-08T23:35:33.793000",
              "content": "<p><a href=\"https://www.kaggle.com/alejopaullier\" target=\"_blank\">@alejopaullier</a> We are talking about pix2struct model. <a href=\"https://huggingface.co/google/pix2struct-base\" target=\"_blank\">https://huggingface.co/google/pix2struct-base</a><br>\nNicholas was actually talking about matcha</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2251003,
              "author_name": "moth",
              "author_url": "",
              "post_date": "2023-05-09T01:27:59.327000",
              "content": "<p>thanks <a href=\"https://www.kaggle.com/zhugds\" target=\"_blank\">@zhugds</a>, I've tried training pix2struct base as an image encoder text decoder (but weirdly predicts always the same text). Matcha seems to require a question as it was trained as a VQA model so I wouldnt know how it can fit this competition's problem (e.g: which question should be asked to get data series)</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2251029,
              "author_name": "june",
              "author_url": "",
              "post_date": "2023-05-09T02:27:34.837000",
              "content": "<p>If you predict the same text, that's what this thread is for. <br>\nTry <code>pip install git+https://github.com/huggingface/transformers.git</code> as Nicholas mentioned and it should work.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2251031,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-09T02:30:07.463000",
              "content": "<p>When you create the processor, you can turn vqa off</p>\n<p><code>processor = AutoProcessor.from_pretrained(\"google/matcha-base\", is_vqa=False)</code></p>",
              "votes": 5,
              "replies": []
            },
            {
              "id": 2251454,
              "author_name": "qdv206",
              "author_url": "",
              "post_date": "2023-05-09T11:02:36.173000",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a>, if you have some time could you kindly have a look at my submissions. I have been implementing many kind of checks for invalid values:</p>\n<ul>\n<li>check for empty string</li>\n<li>force convert every value to float to check if they become inf or nan</li>\n<li>remove ; from generated value</li>\n</ul>\n<p>And yet I keep having Submission Scoring Errors, maybe it's just some simple bug in my code but at this point I would appreciate very much an idea to continue debugging 😅.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2251502,
              "author_name": "Ryan Holbrook",
              "author_url": "",
              "post_date": "2023-05-09T12:09:26.840000",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/qdv206\" target=\"_blank\">@qdv206</a>, I'm seeing <code>ERROR: Record 1256 had 2 columns but expected 3</code>. Maybe you forgot to save the index?</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2251510,
              "author_name": "qdv206",
              "author_url": "",
              "post_date": "2023-05-09T12:25:38.073000",
              "content": "<p><a href=\"https://www.kaggle.com/ryanholbrook\" target=\"_blank\">@ryanholbrook</a> <br>\nThat's strange, on the submission generated from the dummy test set it shows 3 columns for me (I ran the notebook on 10000 images of the train set and the generated submission.csv is also 3 columns). Maybe my post processing caused a problem in a particular sample of the hidden test set.<br>\nThank you very much for your quick reply, it would have taken me a long time to consider this possibility. Now I know where to look 🙏.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2251781,
              "author_name": "SeshuRaju 🧘‍♂️",
              "author_url": "",
              "post_date": "2023-05-09T16:07:04.360000",
              "content": "<p>Training error is between 0.4 to 0.2 (for 3 epochs), but generated strings are having repeated value or wrong values. how to handle this case?  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F761268%2Ff416f1d99b09bd36cac646a7847713c4%2FWB%20Chart%2009_05_2023%2021_31_46.png?generation=1683648143994535&amp;alt=media\" alt=\"\"></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2251795,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-09T16:22:54.427000",
              "content": "<p>Use bf16 if you can.<br>\nMy learning rate was 3e-5.<br>\nI haven't tried using weight decay.<br>\nI didn't use a scheduler either</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2251943,
              "author_name": "Cody_Null",
              "author_url": "",
              "post_date": "2023-05-09T18:52:58.133000",
              "content": "<p>Looks like I need to start trying to figure out matcha! I joined the party a little late here, I was able to get my first donut to .46 and I have a second one submitting now but hard to believe it will be a good solution at the end of competition if so many are getting in the .7's already. Never used this so it should be interesting!  </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2253262,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-10T04:28:29.603000",
              "content": "<p>Updates regarding Training ,  I was able to train and infer with pix2struct and matcha , not high scores (0.51, 0.41)  but acceptable due the small training I did.</p>\n<p>Inference took at first about 8 hrs then I was able to decrease it to 2.5 hours (most likely I can decrease it more).</p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2253646,
              "author_name": "Benedikt Droste",
              "author_url": "",
              "post_date": "2023-05-10T11:21:10.367000",
              "content": "<p>how did you decrease the scoring time?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2253822,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-05-10T13:20:26.583000",
              "content": "<p>I dropped the batching and looped over the test images one by one , this dropped the scoring time from 8 hours to 2.5 hours with same score ! </p>\n<blockquote>\n<pre><code> im  tqdm(images):\n    ids.append(im.stem)\n    :\n        output=pix2struct_predict(im, model.cuda(), processor, device)\n        \n        all_generations.append(output)\n    :\n        all_generations.append()\n</code></pre>\n</blockquote>",
              "votes": 7,
              "replies": []
            },
            {
              "id": 2254634,
              "author_name": "Shai",
              "author_url": "",
              "post_date": "2023-05-11T06:14:54.843000",
              "content": "<p>Use a single GPU (P100) and fit the max batch size it can accommodate. It should be faster than 2.5 hours.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2262477,
              "author_name": "moth",
              "author_url": "",
              "post_date": "2023-05-17T01:26:14.270000",
              "content": "<p>could anyone tell me around how many epochs have you train the model?</p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2262486,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-17T01:42:13.047000",
              "content": "<p>I did 10 epochs</p>",
              "votes": 4,
              "replies": []
            },
            {
              "id": 2262493,
              "author_name": "Cody_Null",
              "author_url": "",
              "post_date": "2023-05-17T01:50:26.977000",
              "content": "<p>Did you do that with the full training dataset or some subset for the sake of time?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2262544,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-17T02:22:31.287000",
              "content": "<p>Full data set </p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2264953,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-05-18T22:06:16.377000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2269105,
              "author_name": "Zaakcii Ru",
              "author_url": "",
              "post_date": "2023-05-22T08:10:16.973000",
              "content": "<p>Could you tell us more about this?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2277382,
              "author_name": "Givan",
              "author_url": "",
              "post_date": "2023-05-27T17:06:10.810000",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> What is the batch size used for training?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2277462,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-27T19:27:14.253000",
              "content": "<p>use whatever batch size your GPU can support. Use gradient checkpointing if you want a bigger one. <a href=\"https://github.com/google-research/tuning_playbook#choosing-the-batch-size\" target=\"_blank\">You should be able to get to the same point no matter what your batch size is.</a></p>",
              "votes": 3,
              "replies": []
            },
            {
              "id": 2277812,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-05-28T04:49:54.597000",
              "content": "<p>I'm currently using matcha with the new transformers but my loss almost always stays near 6. No matter what I do I tried to change max_patches, fixed some bugs what I thought could've made it better.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7210035%2F8884a5cd22fbaca81756980066aa0c1f%2Floss.png?generation=1685249349864560&amp;alt=media\" alt=\"\"></p>\n<p>Any ideas what I could be doing wrong? Was there a major change you had to adopt when switching from donut to matcha?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2277887,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-28T06:33:52.127000",
              "content": "<p>Try formatting the text to be like how it was already trained, not like the format my donut notebook</p>\n<p>See the public deplot notebook for not details</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2278236,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-05-28T13:13:29.200000",
              "content": "<blockquote>\n  <p>I dropped the batching and looped over the test images one by one , this dropped the scoring time from 8 hours to 2.5 hours with same score ! </p>\n  <blockquote>\n<pre><code> im  tqdm(images):\n    ids.append(im.stem)\n    :\n        output=pix2struct_predict(im, model.cuda(), processor, device)\n        \n        all_generations.append(output)\n    :\n        all_generations.append()\n</code></pre>\n  </blockquote>\n</blockquote>\n<p>Hi,<a href=\"https://www.kaggle.com/competitions/benetech-making-graphs-accessible/discussion/406250#2253822\" target=\"_blank\">@Ali Salhi</a> ,why is looping over the test images one by one faster than batching them? </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2278337,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-05-28T15:35:55.733000",
              "content": "<p>From my understanding I did as you said and the ground truth now looks like this </p>\n<p><code>TITLE | &lt;chart_title&gt; &lt;0x0A&gt; &lt;axis_title&gt; | &lt;axis_title&gt; &lt;0x0A&gt; y1 | x1 &lt;0x0A&gt; y2 | x2 &lt;0x0A&gt; y3 | x3 ...</code></p>\n<p>And now the loss bumps around 6.5 and 7. I also tried playing with other checkpoints besides base but they perform 2x worse.</p>\n<p>Edit: Nevermind I found a way to make it work, I removed spaces and changed the text inside the processor, I really had to dig in some discussions and notebooks. My matcha model is running fine with ~ &lt;1 loss but I don't think the loss is very stable, it often varies +- 0.4, is it maybe because I'm using scatterplots too?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2278869,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-05-29T03:29:08.223000",
              "content": "<p>Hi,@<a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">nbroad</a>,there are 6 checkpoints are available for MatCha. Why did you choose matcha-base for training? It seems that plotqa-v1 or plotqa-v2 is more suitable for the current task.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2278872,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-05-29T03:36:59.847000",
              "content": "<p>I think the default task for matcha-base is more similar to this competition than plotqa. I didn't try the other ones, so this is just a hunch.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2279318,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-05-29T09:12:36.430000",
              "content": "<p>Hi,<a href=\"https://www.kaggle.com/chaitanyagiri\" target=\"_blank\">@chaitanyagiri</a>,thank you for sharing your experience<br>\nMy loss is also around 6, and I wonder how did you solve it? What does ‘emoved spaces and changed the text inside the processor’ mean? </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2280593,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-05-30T07:49:03.203000",
              "content": "<blockquote>\n  <p>use whatever batch size your GPU can support. Use gradient checkpointing if you want a bigger one. <a href=\"https://github.com/google-research/tuning_playbook#choosing-the-batch-size\" target=\"_blank\">You should be able to get to the same point no matter what your batch size is.</a></p>\n</blockquote>\n<p>Hi,<a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a>,when i used gradient checkpointing with the following code,an error popped up<br>\n<code>model = Pix2StructForConditionalGeneration.from_pretrained(Config['MODEL_NAME'])\nmodel.gradient_checkpointing_enable()</code><br>\n<code>ValueError: Pix2StructForConditionalGeneration does not support gradient checkpointing.</code><br>\nMay I ask if there is an error in my code?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2280800,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-05-30T11:10:57.833000",
              "content": "<p><a href=\"https://www.kaggle.com/areno9516\" target=\"_blank\">@areno9516</a> Look at the deplot public notebook and see the Pix2StructProcessor call. You may have to change the text inside that particular call. Check <a href=\"https://www.kaggle.com/evilpsycho42\" target=\"_blank\">@evilpsycho42</a> 's comment on this thread.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2283659,
              "author_name": "Givan",
              "author_url": "",
              "post_date": "2023-06-01T12:26:39.243000",
              "content": "<p>I am training the pix2struct model. The loss is decreasing normally but eventually stabilizes around 0.7, while I see that your training loss stabilizes around 0.3+. Moreover, when I used sample test images for prediction, the results seemed to be very bad. What could be the possible reasons for this?<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2382612%2F66b760cb4545b6f703bf294ff138fc83%2Floss.png?generation=1685622383943646&amp;alt=media\" alt=\"loss\"></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2283724,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-06-01T13:08:00.167000",
              "content": "<p>Hi,<a href=\"https://www.kaggle.com/marbury\" target=\"_blank\">@marbury</a>,when calculating loss, you can ignore padding tokens. After I ignored the padding tokens, the loss has decreased significantly, which may be useful for you. By the way, my model suffered unstable losses during training, and I would like to ask if you have encountered such a situation.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2283985,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-06-01T16:36:57.607000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2283986,
              "author_name": "Zaakcii Ru",
              "author_url": "",
              "post_date": "2023-06-01T16:37:52.233000",
              "content": "<p>Try this: config.gradient checkpointing=True or model.config.gradient checkpointing=True, I didn't notice much difference. It's possible that I just don't understand something.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2284001,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-06-01T16:52:02.783000",
              "content": "<p><a href=\"https://www.kaggle.com/areno9516\" target=\"_blank\">@areno9516</a> </p>\n<p>model.encoder.gradient_checkpointing_enable()</p>\n<p>model.decoder.gradient_checkpointing_enable()</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2284006,
              "author_name": "Givan",
              "author_url": "",
              "post_date": "2023-06-01T16:58:54.717000",
              "content": "<p><a href=\"https://www.kaggle.com/areno9516\" target=\"_blank\">@areno9516</a> <a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> Do I need to modify the source code in pix2struct transformers to ignore padding tokens when calculate the loss?</p>\n<p>It seems that they have already done this in transformers.</p>\n<pre><code> labels   :\n            \n            labels = labels.to(logits.device)\n            loss_fct = nn.CrossEntropyLoss(ignore_index=-, reduction=)\n</code></pre>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2284127,
              "author_name": "Nicholas Broad",
              "author_url": "",
              "post_date": "2023-06-01T18:33:33.270000",
              "content": "<p>You need to set the labels to be -100 to get ignored</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2284596,
              "author_name": "Givan",
              "author_url": "",
              "post_date": "2023-06-02T07:01:37.843000",
              "content": "<p><a href=\"https://www.kaggle.com/nbroad\" target=\"_blank\">@nbroad</a> Thanks, I have set the pad_token_id to -100 as you do in your public notebook. However, the loss is still not decreased as expected.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2382612%2Fc6dbb72435ecfc3709e3b8b21513f2f4%2Floss.png?generation=1685689292833465&amp;alt=media\" alt=\"\"></p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2284918,
              "author_name": "Givan",
              "author_url": "",
              "post_date": "2023-06-02T10:54:16.630000",
              "content": "<blockquote>\n  <p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3575309%2F90ce092fb07bc284e03991bcf06b5f2e%2FWB%20Chart%205_2_2023%2010_28_00%20PM.png?generation=1683091692082912&amp;alt=media\" alt=\"\"></p>\n</blockquote>\n<p>Do you include the scatter plot images for training in this train loss?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2294656,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-06-10T07:54:12.500000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2294660,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-06-10T07:57:35.320000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2294663,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-06-10T07:59:45.023000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2294665,
              "author_name": "some_train",
              "author_url": "",
              "post_date": "2023-06-10T08:00:44.943000",
              "content": "<p>Hi, I was wondering what else have you done besides this method to reduce the scoring time, since my current scoring time is so long that it takes 6 hours</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2295823,
              "author_name": "",
              "author_url": "",
              "post_date": "2023-06-11T09:30:42.597000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2295824,
              "author_name": "allen wang",
              "author_url": "",
              "post_date": "2023-06-11T09:31:27.853000",
              "content": "<p>Did you pre-train the model using matcha-plotqa-v2? Is the training labeled xxxyyy or xyxy? The loss never goes down</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2301417,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-06-13T22:40:45.200000",
              "content": "<p>Hi <a href=\"https://www.kaggle.com/areno\" target=\"_blank\">@areno</a>, I see that you mentioned you had an unstable loss. Do you still have it? If not may I ask what was your workaround for that?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2301552,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-06-14T02:40:46.680000",
              "content": "<p>Hi,<a href=\"https://www.kaggle.com/chaitanyagiri\" target=\"_blank\">@chaitanyagiri</a><br>\nYou may be able to ignore that. My loss was unstable, with an average value of about 0.2, but fluctuating between 0.05 and 0.6.And the model finally got 0.75 cv and 0.68 lb </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2301761,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-06-14T06:39:32.890000",
              "content": "<p>My loss fluctuates between 0.8 and 0 and the average is 0.35. I tried increasing lr but it's still the same. I'm using deplot, what about you?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2301802,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-06-14T07:10:17.780000",
              "content": "<blockquote>\n  <p>My loss fluctuates between 0.8 and 0 and the average is 0.35. I tried increasing lr but it's still the same. I'm using deplot, what about you?</p>\n</blockquote>\n<p>I have tried the Matcha and Deplot models.Their losses are close and Matcha‘s scores are slightly better. My Learning rate is 3e-5</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2302497,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-06-14T15:29:06.357000",
              "content": "<p>And do you use the competition's dataset or the 500k images one?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2302974,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-06-15T02:10:02.057000",
              "content": "<blockquote>\n  <p>And do you use the competition's dataset or the 500k images one?</p>\n</blockquote>\n<p>I used the competition's dataset and 100k images of 500k images</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2303350,
              "author_name": "Chaitanya Giri",
              "author_url": "",
              "post_date": "2023-06-15T08:58:33.680000",
              "content": "<p>So the 100k images were of scatterplots or stratified the images like 20k from each. And how many epochs do you train for? I kinda notice that my losses doesn't seem to go down after the 2nd</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2304446,
              "author_name": "areno",
              "author_url": "",
              "post_date": "2023-06-16T02:16:03.080000",
              "content": "<blockquote>\n  <p>So the 100k images were of scatterplots or stratified the images like 20k from each. And how many epochs do you train for? I kinda notice that my losses doesn't seem to go down after the 2nd</p>\n</blockquote>\n<p>20k for each type of chart. I trained three epochs. Maybe you can try a smaller lr</p>",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2271435,
          "author_name": "Bartley",
          "author_url": "",
          "post_date": "2023-05-23T22:29:06.937000",
          "content": "<p>Thanks everyone for sharing. I have learnt a lot from this discussion.</p>\n<p></p>\n<p></p>\n<p></p>\n<p>Update: I had max patches set to 4.. </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2306839,
      "author_name": "Bo Peng",
      "author_url": "",
      "post_date": "2023-06-17T16:16:25.600000",
      "content": "<p>Is there a public code/notebook that is best to use for Matcha model? </p>\n<p>Thanks.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2254461,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-05-11T02:36:24.667000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2241608": "You should read this thread: https://github.com/huggingface/transformers/issues/22903\n\ntldr: make sure to set `model.config.text_config.is_decoder=True` and don't use label smoothing. It should produce 60+ scores then\n\n\nIf you do `pip install git+https://github.com/huggingface/transformers.git`, then it should work fine without any modifications",
    "2300948": "Thanks for sharing @nbroad !\n\nHave you tired inference with Pix2Struct, MatCha or DePlot? If so were the results reasonable?\n\nKeep up with the great work🔥💪",
    "2280277": "Thanks for your sharing!  @nbroad \n\ntried matcha models & pix2struct,  only got highest 0.6 cv in local.\n- lr 4e-5\n- epochs 2\n- batch size 2\n- Adam\n- no prompt\n\ndo you pass any prompts to model?  (just like deplot inputs = processor(images=image, text=\"Generate underlying data table of the figure below:\", return_tensors=\"pt\"))",
    "2273592": "may I know your MatCha inference  speed, my model inference is too slow and always time out.",
    "2265780": "how will you download as the submission is without the internet?\n",
    "2255915": "Hi Nicholas, did you try to submit a notebook that uses the DePlot model? I found that the model is trying to download something from the Internet and this will cause the run to fail. Did you figure out a way to solve this problem? ",
    "2241852": "Thanks for sharing. Have you tried it yet?",
    "2242142": "Thanks. Do these models work better than donut?",
    "2306839": "Is there a public code/notebook that is best to use for Matcha model? \n\nThanks.\n\n\n",
    "2254461": ""
  }
}