{
  "id": 460098,
  "title": "The problem of using gpu kaggle",
  "url": "/competitions/UBC-OCEAN/discussion/460098",
  "author_name": "Erfan Saeedi",
  "post_date": "2023-12-07T20:20:04.098000",
  "votes": 2,
  "comment_count": 5,
  "views": 0,
  "content": "<p>The problem I have is that when I want to use gpu, it does not use gpu processing power during training. What is the reason?</p>",
  "messages": [
    {
      "id": 2556214,
      "postDate": "2023-12-10T14:36:58.967Z",
      "content": "<p>hi Erfan, <br>\nit can have a few reasons, without seeing your notebook it is hard to tell, </p>\n<p>first of all, are you choosing \"GPU\" as Accelerator from \"Notebook options\"?</p>\n<p>if yes, then you need to check you code, if you are using Tensorflow, make sure you </p>\n<p><code>\nprint(\"Num GPUs Available: \", len(tf.config.list_physical_devices('GPU')))\n</code></p>\n<p>if you are using Pytorch, you may need to map your model and input data into GPU device, </p>\n<p>as I mentioned, without seeing what you are doing it is hard to tell, let me know if you can share your notebook, so I can help further :) </p>",
      "rawMarkdown": "hi Erfan, \nit can have a few reasons, without seeing your notebook it is hard to tell, \n\nfirst of all, are you choosing \"GPU\" as Accelerator from \"Notebook options\"?\n\nif yes, then you need to check you code, if you are using Tensorflow, make sure you \n\n`\nprint(\"Num GPUs Available: \", len(tf.config.list_physical_devices('GPU')))\n`\n\nif you are using Pytorch, you may need to map your model and input data into GPU device, \n\nas I mentioned, without seeing what you are doing it is hard to tell, let me know if you can share your notebook, so I can help further :) ",
      "votes": 1,
      "replies": [
        {
          "id": 2558090,
          "postDate": "2023-12-11T21:31:52.550Z",
          "content": "<p>Hello, thank you for your reply. I wrote a simple code to get an insight about accuracy.  I put the link of the notebook at the bottom, I have two problems 1. It doesn't use gpu 2.  When I submit, it gives me an error, while the submit code is similar to the submitted notebooks of other people. Thank you for your guidance.<br>\n<a href=\"https://www.kaggle.com/code/erfansaeedi/simple/notebook\" target=\"_blank\">https://www.kaggle.com/code/erfansaeedi/simple/notebook</a></p>",
          "rawMarkdown": "Hello, thank you for your reply. I wrote a simple code to get an insight about accuracy.  I put the link of the notebook at the bottom, I have two problems 1. It doesn't use gpu 2.  When I submit, it gives me an error, while the submit code is similar to the submitted notebooks of other people. Thank you for your guidance.\nhttps://www.kaggle.com/code/erfansaeedi/simple/notebook",
          "votes": 1,
          "replies": [
            {
              "id": 2561696,
              "postDate": "2023-12-14T18:07:41.930Z",
              "content": "<p>I see, <br>\nfirst of all it is good practice to separate training and submission notebook from each other, have a 2 notebook, one for training, and second one for submission basically, </p>\n<p>I'm not sure how you using the notebook you attached, but how do you read trained model? it should be attached to your notebook when you submitting it, but it is not in your notebook submission, <br>\nif you training your model during submission, it will not work (host mentioned that training data will not be available during submission because of huge data size of test set)</p>\n<p>as I mentioned, separate your training and submission notebook, train on a notebook, do a \"Save Version\" with GPU, and then add it as input to your submission notebook,  </p>\n<p>let me know if you got what I explained! </p>",
              "rawMarkdown": "I see, \nfirst of all it is good practice to separate training and submission notebook from each other, have a 2 notebook, one for training, and second one for submission basically, \n\nI'm not sure how you using the notebook you attached, but how do you read trained model? it should be attached to your notebook when you submitting it, but it is not in your notebook submission, \nif you training your model during submission, it will not work (host mentioned that training data will not be available during submission because of huge data size of test set)\n\nas I mentioned, separate your training and submission notebook, train on a notebook, do a \"Save Version\" with GPU, and then add it as input to your submission notebook,  \n\nlet me know if you got what I explained! ",
              "votes": 2
            },
            {
              "id": 2562944,
              "postDate": "2023-12-15T20:08:22.377Z",
              "content": "<p>Thank you for your help, Ali; the problem is solved. I would be happy if you are willing to collaborate on improving the model in this competition</p>",
              "rawMarkdown": "Thank you for your help, Ali; the problem is solved. I would be happy if you are willing to collaborate on improving the model in this competition",
              "votes": 1
            },
            {
              "id": 2563544,
              "postDate": "2023-12-16T11:58:33.713Z",
              "content": "<p>your welcome, happy to hear it worked, <br>\nsure I'm willing to collaborate, but the remaining time for this one is almost 2 weeks, I don't think we can do too much in 2 weeks, we may wait or pick up another competition to work on </p>",
              "rawMarkdown": "your welcome, happy to hear it worked, \nsure I'm willing to collaborate, but the remaining time for this one is almost 2 weeks, I don't think we can do too much in 2 weeks, we may wait or pick up another competition to work on "
            }
          ]
        }
      ]
    },
    {
      "id": 2552904,
      "postDate": "2023-12-07T20:20:04.100Z",
      "content": "<p>The problem I have is that when I want to use gpu, it does not use gpu processing power during training. What is the reason?</p>",
      "rawMarkdown": "The problem I have is that when I want to use gpu, it does not use gpu processing power during training. What is the reason?",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 2556214,
      "author_name": "Ali",
      "author_url": "",
      "post_date": "2023-12-10T14:36:58.967000",
      "content": "<p>hi Erfan, <br>\nit can have a few reasons, without seeing your notebook it is hard to tell, </p>\n<p>first of all, are you choosing \"GPU\" as Accelerator from \"Notebook options\"?</p>\n<p>if yes, then you need to check you code, if you are using Tensorflow, make sure you </p>\n<p><code>\nprint(\"Num GPUs Available: \", len(tf.config.list_physical_devices('GPU')))\n</code></p>\n<p>if you are using Pytorch, you may need to map your model and input data into GPU device, </p>\n<p>as I mentioned, without seeing what you are doing it is hard to tell, let me know if you can share your notebook, so I can help further :) </p>",
      "votes": 1,
      "replies": [
        {
          "id": 2558090,
          "author_name": "Erfan Saeedi",
          "author_url": "",
          "post_date": "2023-12-11T21:31:52.550000",
          "content": "<p>Hello, thank you for your reply. I wrote a simple code to get an insight about accuracy.  I put the link of the notebook at the bottom, I have two problems 1. It doesn't use gpu 2.  When I submit, it gives me an error, while the submit code is similar to the submitted notebooks of other people. Thank you for your guidance.<br>\n<a href=\"https://www.kaggle.com/code/erfansaeedi/simple/notebook\" target=\"_blank\">https://www.kaggle.com/code/erfansaeedi/simple/notebook</a></p>",
          "votes": 1,
          "replies": [
            {
              "id": 2561696,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-12-14T18:07:41.930000",
              "content": "<p>I see, <br>\nfirst of all it is good practice to separate training and submission notebook from each other, have a 2 notebook, one for training, and second one for submission basically, </p>\n<p>I'm not sure how you using the notebook you attached, but how do you read trained model? it should be attached to your notebook when you submitting it, but it is not in your notebook submission, <br>\nif you training your model during submission, it will not work (host mentioned that training data will not be available during submission because of huge data size of test set)</p>\n<p>as I mentioned, separate your training and submission notebook, train on a notebook, do a \"Save Version\" with GPU, and then add it as input to your submission notebook,  </p>\n<p>let me know if you got what I explained! </p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2562944,
              "author_name": "Erfan Saeedi",
              "author_url": "",
              "post_date": "2023-12-15T20:08:22.377000",
              "content": "<p>Thank you for your help, Ali; the problem is solved. I would be happy if you are willing to collaborate on improving the model in this competition</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2563544,
              "author_name": "Ali",
              "author_url": "",
              "post_date": "2023-12-16T11:58:33.713000",
              "content": "<p>your welcome, happy to hear it worked, <br>\nsure I'm willing to collaborate, but the remaining time for this one is almost 2 weeks, I don't think we can do too much in 2 weeks, we may wait or pick up another competition to work on </p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2556214": "hi Erfan, \nit can have a few reasons, without seeing your notebook it is hard to tell, \n\nfirst of all, are you choosing \"GPU\" as Accelerator from \"Notebook options\"?\n\nif yes, then you need to check you code, if you are using Tensorflow, make sure you \n\n`\nprint(\"Num GPUs Available: \", len(tf.config.list_physical_devices('GPU')))\n`\n\nif you are using Pytorch, you may need to map your model and input data into GPU device, \n\nas I mentioned, without seeing what you are doing it is hard to tell, let me know if you can share your notebook, so I can help further :) ",
    "2552904": "The problem I have is that when I want to use gpu, it does not use gpu processing power during training. What is the reason?"
  }
}