{
  "id": 567861,
  "title": "Submission Failed",
  "url": "/competitions/stanford-rna-3d-folding/discussion/567861",
  "author_name": "",
  "post_date": "2025-03-12T13:30:22.149536100Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi All<br>\nI have been trying to submit a submission test file with random numbers entered to check the file format is correct, and I keep running into failures. Any of you kind and intelligent souls know why?<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F09759580fddaa729aa98fdb11c6624ab%2FRNA%20Fail.png?generation=1741786189026519&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2Fcbb2c0be26a94a5215f7cac5559dcc8d%2FRNA%20Fail2.png?generation=1741786206957989&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F4b1cae59dbb535ec4655f44b7a6cd948%2FRNAFail3.png?generation=1741786215901988&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "3147848",
      "postDate": "03/12/2025 13:30:22",
      "content": "<p>Hi All<br>\nI have been trying to submit a submission test file with random numbers entered to check the file format is correct, and I keep running into failures. Any of you kind and intelligent souls know why?<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F09759580fddaa729aa98fdb11c6624ab%2FRNA%20Fail.png?generation=1741786189026519&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2Fcbb2c0be26a94a5215f7cac5559dcc8d%2FRNA%20Fail2.png?generation=1741786206957989&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F4b1cae59dbb535ec4655f44b7a6cd948%2FRNAFail3.png?generation=1741786215901988&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Hi All\nI have been trying to submit a submission test file with random numbers entered to check the file format is correct, and I keep running into failures. Any of you kind and intelligent souls know why?![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F09759580fddaa729aa98fdb11c6624ab%2FRNA%20Fail.png?generation=1741786189026519&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2Fcbb2c0be26a94a5215f7cac5559dcc8d%2FRNA%20Fail2.png?generation=1741786206957989&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F4b1cae59dbb535ec4655f44b7a6cd948%2FRNAFail3.png?generation=1741786215901988&alt=media)",
      "votes": null
    },
    {
      "id": "3147892",
      "postDate": "03/12/2025 14:15:09",
      "content": "<p>there's an error symbol (warning triangle) next to your submission, you can click on that warning triangle icon to see more details (although very brief) about what caused the error. </p>",
      "rawMarkdown": "there's an error symbol (warning triangle) next to your submission, you can click on that warning triangle icon to see more details (although very brief) about what caused the error.",
      "votes": null
    },
    {
      "id": "3148165",
      "postDate": "03/12/2025 19:32:51",
      "content": "<p>You can Use My Inference&nbsp;(if works with your Environment)</p>\n<pre><code>    \n    all_preds = []\n     i  tqdm(((test_dataset)), desc=):\n        sample = test_dataset[i]\n        src = sample[].unsqueeze().to(device)\n        mask = sample[].unsqueeze().to(device)\n        preds = []\n\n        model.train()\n         _  ():\n             torch.no_grad():\n                xyz = model(src, src_mask=mask)\n            \n            pad_size = (sample[]) - xyz.shape[]  \n             pad_size &gt; :\n                padding = torch.zeros(, pad_size, , device=xyz.device)  \n                xyz = torch.cat([xyz, padding], dim=)          \n            preds.append(xyz.squeeze().cpu().numpy())\n\n\n        model.()\n         torch.no_grad():\n            xyz = model(src, src_mask=mask)\n            \n            pad_size = (sample[]) - xyz.shape[]\n             pad_size &gt; :\n                padding = torch.zeros(, pad_size, , device=xyz.device)\n                xyz = torch.cat([xyz, padding], dim=)\n            preds.append(xyz.squeeze().cpu().numpy())\n\n        preds = np.stack(preds, axis=)\n        all_preds.append(preds)\n\n\n    \n    submission_data = []\n     i, sample  (tqdm(test_dataset, desc=)):\n        target_id = sample[]\n        seq_str = sample[]  \n        preds = all_preds[i]\n        L = (seq_str)  \n         j  (L):\n            row = [, seq_str[j], j+]\n             k  ():\n                x, y, z = preds[k][j]\n                 np.isnan(x)  np.isinf(x):\n                    x = \n                 np.isnan(y)  np.isinf(y):\n                    y = \n                 np.isnan(z)  np.isinf(z):\n                    z = \n                row.extend([, , ])\n            submission_data.append(row)\n\n    columns = [, , ]\n     i  (, ):\n        columns.extend([, , ])\n\n    submission_df = pd.DataFrame(submission_data, columns=columns)\n\n    \n     i  (, ):\n        submission_df[] = submission_df[].astype()\n        submission_df[] = submission_df[].astype()\n        submission_df[] = submission_df[].astype()\n    submission_df[] = submission_df[].astype()\n    submission_df = submission_df.fillna()\n    submission_df.to_csv(, index=)\n    ()\n    (submission_df.head())\n</code></pre>\n<p>Make sure you extract correct&nbsp;logic for correct parameters!&nbsp;</p>",
      "rawMarkdown": "You can Use My Inference (if works with your Environment)\n```python\n\n    # --- Inference ---\n    all_preds = []\n    for i in tqdm(range(len(test_dataset)), desc=\"Inference\"):\n        sample = test_dataset[i]\n        src = sample['sequence'].unsqueeze(0).to(device)\n        mask = sample['mask'].unsqueeze(0).to(device)\n        preds = []\n\n        model.train()\n        for _ in range(4):\n            with torch.no_grad():\n                xyz = model(src, src_mask=mask)\n            # Crucially, pad the predictions with zeros to match the *original* sequence length.\n            pad_size = len(sample['seq_str']) - xyz.shape[1]  # Calculate padding needed\n            if pad_size > 0:\n                padding = torch.zeros(1, pad_size, 3, device=xyz.device)  # Create padding tensor\n                xyz = torch.cat([xyz, padding], dim=1)          # Concatenate padding\n            preds.append(xyz.squeeze(0).cpu().numpy())\n\n\n        model.eval()\n        with torch.no_grad():\n            xyz = model(src, src_mask=mask)\n            #  Pad the predictions (same as above).\n            pad_size = len(sample['seq_str']) - xyz.shape[1]\n            if pad_size > 0:\n                padding = torch.zeros(1, pad_size, 3, device=xyz.device)\n                xyz = torch.cat([xyz, padding], dim=1)\n            preds.append(xyz.squeeze(0).cpu().numpy())\n\n        preds = np.stack(preds, axis=0)\n        all_preds.append(preds)\n\n\n    # --- Create Submission File ---\n    submission_data = []\n    for i, sample in enumerate(tqdm(test_dataset, desc=\"Creating Submission\")):\n        target_id = sample['target_id']\n        seq_str = sample['seq_str']  # Now this is the *full* sequence.\n        preds = all_preds[i]\n        L = len(seq_str)  # Use the length of the *full* sequence.\n        for j in range(L):\n            row = [f\"{target_id}_{j+1}\", seq_str[j], j+1]\n            for k in range(5):\n                x, y, z = preds[k][j]\n                if np.isnan(x) or np.isinf(x):\n                    x = 0.0\n                if np.isnan(y) or np.isinf(y):\n                    y = 0.0\n                if np.isnan(z) or np.isinf(z):\n                    z = 0.0\n                row.extend([f\"{x:.3f}\", f\"{y:.3f}\", f\"{z:.3f}\"])\n            submission_data.append(row)\n\n    columns = ['ID', 'resname', 'resid']\n    for i in range(1, 6):\n        columns.extend([f\"x_{i}\", f\"y_{i}\", f\"z_{i}\"])\n\n    submission_df = pd.DataFrame(submission_data, columns=columns)\n\n    # --- Force Data Types (Important) ---\n    for i in range(1, 6):\n        submission_df[f'x_{i}'] = submission_df[f'x_{i}'].astype(float)\n        submission_df[f'y_{i}'] = submission_df[f'y_{i}'].astype(float)\n        submission_df[f'z_{i}'] = submission_df[f'z_{i}'].astype(float)\n    submission_df['resid'] = submission_df['resid'].astype(int)\n    submission_df = submission_df.fillna(0.0)\n    submission_df.to_csv(\"submission.csv\", index=False)\n    print(\"Submission file created: submission.csv\")\n    print(submission_df.head())\n```\n\nMake sure you extract correct logic for correct parameters!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3147892,
      "author_name": "jaejohn",
      "author_url": "",
      "post_date": "03/12/2025 14:15:09",
      "content": "<p>there's an error symbol (warning triangle) next to your submission, you can click on that warning triangle icon to see more details (although very brief) about what caused the error. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 3148165,
      "author_name": "sangrampatil5150",
      "author_url": "",
      "post_date": "03/12/2025 19:32:51",
      "content": "<p>You can Use My Inference&nbsp;(if works with your Environment)</p>\n<pre><code>    \n    all_preds = []\n     i  tqdm(((test_dataset)), desc=):\n        sample = test_dataset[i]\n        src = sample[].unsqueeze().to(device)\n        mask = sample[].unsqueeze().to(device)\n        preds = []\n\n        model.train()\n         _  ():\n             torch.no_grad():\n                xyz = model(src, src_mask=mask)\n            \n            pad_size = (sample[]) - xyz.shape[]  \n             pad_size &gt; :\n                padding = torch.zeros(, pad_size, , device=xyz.device)  \n                xyz = torch.cat([xyz, padding], dim=)          \n            preds.append(xyz.squeeze().cpu().numpy())\n\n\n        model.()\n         torch.no_grad():\n            xyz = model(src, src_mask=mask)\n            \n            pad_size = (sample[]) - xyz.shape[]\n             pad_size &gt; :\n                padding = torch.zeros(, pad_size, , device=xyz.device)\n                xyz = torch.cat([xyz, padding], dim=)\n            preds.append(xyz.squeeze().cpu().numpy())\n\n        preds = np.stack(preds, axis=)\n        all_preds.append(preds)\n\n\n    \n    submission_data = []\n     i, sample  (tqdm(test_dataset, desc=)):\n        target_id = sample[]\n        seq_str = sample[]  \n        preds = all_preds[i]\n        L = (seq_str)  \n         j  (L):\n            row = [, seq_str[j], j+]\n             k  ():\n                x, y, z = preds[k][j]\n                 np.isnan(x)  np.isinf(x):\n                    x = \n                 np.isnan(y)  np.isinf(y):\n                    y = \n                 np.isnan(z)  np.isinf(z):\n                    z = \n                row.extend([, , ])\n            submission_data.append(row)\n\n    columns = [, , ]\n     i  (, ):\n        columns.extend([, , ])\n\n    submission_df = pd.DataFrame(submission_data, columns=columns)\n\n    \n     i  (, ):\n        submission_df[] = submission_df[].astype()\n        submission_df[] = submission_df[].astype()\n        submission_df[] = submission_df[].astype()\n    submission_df[] = submission_df[].astype()\n    submission_df = submission_df.fillna()\n    submission_df.to_csv(, index=)\n    ()\n    (submission_df.head())\n</code></pre>\n<p>Make sure you extract correct&nbsp;logic for correct parameters!&nbsp;</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3147848": "Hi All\nI have been trying to submit a submission test file with random numbers entered to check the file format is correct, and I keep running into failures. Any of you kind and intelligent souls know why?![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F09759580fddaa729aa98fdb11c6624ab%2FRNA%20Fail.png?generation=1741786189026519&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2Fcbb2c0be26a94a5215f7cac5559dcc8d%2FRNA%20Fail2.png?generation=1741786206957989&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F22687101%2F4b1cae59dbb535ec4655f44b7a6cd948%2FRNAFail3.png?generation=1741786215901988&alt=media)",
    "3147892": "there's an error symbol (warning triangle) next to your submission, you can click on that warning triangle icon to see more details (although very brief) about what caused the error.",
    "3148165": "You can Use My Inference (if works with your Environment)\n```python\n\n    # --- Inference ---\n    all_preds = []\n    for i in tqdm(range(len(test_dataset)), desc=\"Inference\"):\n        sample = test_dataset[i]\n        src = sample['sequence'].unsqueeze(0).to(device)\n        mask = sample['mask'].unsqueeze(0).to(device)\n        preds = []\n\n        model.train()\n        for _ in range(4):\n            with torch.no_grad():\n                xyz = model(src, src_mask=mask)\n            # Crucially, pad the predictions with zeros to match the *original* sequence length.\n            pad_size = len(sample['seq_str']) - xyz.shape[1]  # Calculate padding needed\n            if pad_size > 0:\n                padding = torch.zeros(1, pad_size, 3, device=xyz.device)  # Create padding tensor\n                xyz = torch.cat([xyz, padding], dim=1)          # Concatenate padding\n            preds.append(xyz.squeeze(0).cpu().numpy())\n\n\n        model.eval()\n        with torch.no_grad():\n            xyz = model(src, src_mask=mask)\n            #  Pad the predictions (same as above).\n            pad_size = len(sample['seq_str']) - xyz.shape[1]\n            if pad_size > 0:\n                padding = torch.zeros(1, pad_size, 3, device=xyz.device)\n                xyz = torch.cat([xyz, padding], dim=1)\n            preds.append(xyz.squeeze(0).cpu().numpy())\n\n        preds = np.stack(preds, axis=0)\n        all_preds.append(preds)\n\n\n    # --- Create Submission File ---\n    submission_data = []\n    for i, sample in enumerate(tqdm(test_dataset, desc=\"Creating Submission\")):\n        target_id = sample['target_id']\n        seq_str = sample['seq_str']  # Now this is the *full* sequence.\n        preds = all_preds[i]\n        L = len(seq_str)  # Use the length of the *full* sequence.\n        for j in range(L):\n            row = [f\"{target_id}_{j+1}\", seq_str[j], j+1]\n            for k in range(5):\n                x, y, z = preds[k][j]\n                if np.isnan(x) or np.isinf(x):\n                    x = 0.0\n                if np.isnan(y) or np.isinf(y):\n                    y = 0.0\n                if np.isnan(z) or np.isinf(z):\n                    z = 0.0\n                row.extend([f\"{x:.3f}\", f\"{y:.3f}\", f\"{z:.3f}\"])\n            submission_data.append(row)\n\n    columns = ['ID', 'resname', 'resid']\n    for i in range(1, 6):\n        columns.extend([f\"x_{i}\", f\"y_{i}\", f\"z_{i}\"])\n\n    submission_df = pd.DataFrame(submission_data, columns=columns)\n\n    # --- Force Data Types (Important) ---\n    for i in range(1, 6):\n        submission_df[f'x_{i}'] = submission_df[f'x_{i}'].astype(float)\n        submission_df[f'y_{i}'] = submission_df[f'y_{i}'].astype(float)\n        submission_df[f'z_{i}'] = submission_df[f'z_{i}'].astype(float)\n    submission_df['resid'] = submission_df['resid'].astype(int)\n    submission_df = submission_df.fillna(0.0)\n    submission_df.to_csv(\"submission.csv\", index=False)\n    print(\"Submission file created: submission.csv\")\n    print(submission_df.head())\n```\n\nMake sure you extract correct logic for correct parameters!"
  },
  "source": "meta"
}