CoolFace
Datasetpublic

Anurag1734/cuda-error-resolution-analysis

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes7downloads
topics_batch_306.json62887 linesDownload Raw Back to raw
1[2  {3    "post_stream": {4      "posts": [5        {6          "id": 306615,7          "name": "Linux Penguin",8          "username": "Linux_Penguin",9          "avatar_template": "/user_avatar/discuss.pytorch.org/linux_penguin/{size}/34659_2.png",10          "created_at": "2021-09-13T12:43:56.493Z",11          "cooked": "<p>Hi, I am new to AI and decided to use Pytorch. I want to this model to generate some images, however as this was written before Pytorch 1.5, since the gradient calculation has been fixed then, this is the error message.</p>\n<blockquote>\n<blockquote>\n<blockquote>\n<p>RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 512, 4, 4]] is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).&lt;&lt;&lt;</p>\n</blockquote>\n</blockquote>\n</blockquote>\n<p>I have looked at past examples and am not sure what is the problem, I believe it is happening within this region but I don’t know where! Any help would be greatly appreciated!</p>\n<blockquote>\n<blockquote>\n<blockquote>\n<p>def process(self, images, edges, masks):<br>\nself.iteration += 1</p>\n</blockquote>\n</blockquote>\n</blockquote>\n<pre><code>    # zero optimizers\n    self.gen_optimizer.zero_grad()\n    self.dis_optimizer.zero_grad()\n\n\n    # process outputs\n    outputs = self(images, edges, masks)\n    gen_loss = 0\n    dis_loss = 0\n\n\n    # discriminator loss\n    dis_input_real = torch.cat((images, edges), dim=1)\n    dis_input_fake = torch.cat((images, outputs.detach()), dim=1)\n    dis_real, dis_real_feat = self.discriminator(dis_input_real)        # in: (grayscale(1) + edge(1))\n    dis_fake, dis_fake_feat = self.discriminator(dis_input_fake)        # in: (grayscale(1) + edge(1))\n    dis_real_loss = self.adversarial_loss(dis_real, True, True)\n    dis_fake_loss = self.adversarial_loss(dis_fake, False, True)\n    dis_loss += (dis_real_loss + dis_fake_loss) / 2\n\n\n    # generator adversarial loss\n    gen_input_fake = torch.cat((images, outputs), dim=1)\n    gen_fake, gen_fake_feat = self.discriminator(gen_input_fake)        # in: (grayscale(1) + edge(1))\n    gen_gan_loss = self.adversarial_loss(gen_fake, True, False)\n    gen_loss += gen_gan_loss\n\n\n    # generator feature matching loss\n    gen_fm_loss = 0\n    for i in range(len(dis_real_feat)):\n        gen_fm_loss += self.l1_loss(gen_fake_feat[i], dis_real_feat[i].detach())\n    gen_fm_loss = gen_fm_loss * self.config.FM_LOSS_WEIGHT\n    gen_loss += gen_fm_loss\n\n\n    # create logs\n    logs = [\n        (\"l_d1\", dis_loss.item()),\n        (\"l_g1\", gen_gan_loss.item()),\n        (\"l_fm\", gen_fm_loss.item()),\n    ]\n\n    return outputs, gen_loss, dis_loss, logs\n\ndef forward(self, images, edges, masks):\n    edges_masked = (edges * (1 - masks))\n    images_masked = (images * (1 - masks)) + masks\n    inputs = torch.cat((images_masked, edges_masked, masks), dim=1)\n    outputs = self.generator(inputs)                                    # in: [grayscale(1) + edge(1) + mask(1)]\n    return outputs\n\ndef backward(self, gen_loss=None, dis_loss=None):\n    if dis_loss is not None:\n        dis_loss.backward()\n    self.dis_optimizer.step()\n\n    if gen_loss is not None:\n        gen_loss.backward()\n    self.gen_optimizer.step()&lt;&lt;&lt;\n</code></pre>",12          "post_number": 1,13          "post_type": 1,14          "posts_count": 3,15          "updated_at": "2021-09-13T12:43:56.493Z",16          "reply_count": 0,17          "reply_to_post_number": null,18          "quote_count": 0,19          "incoming_link_count": 33,20          "reads": 5,21          "readers_count": 4,22          "score": 166.0,23          "yours": false,24          "topic_id": 131848,25          "topic_slug": "one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation-for-this-specific-piece-of-code",26          "display_username": "Linux Penguin",27          "primary_group_name": null,28          "flair_name": null,29          "flair_url": null,30          "flair_bg_color": null,31          "flair_color": null,32          "flair_group_id": null,33          "badges_granted": [],34          "version": 1,35          "can_edit": false,36          "can_delete": false,37          "can_recover": false,38          "can_see_hidden_post": false,39          "can_wiki": false,40          "read": true,41          "user_title": null,42          "bookmarked": false,43          "actions_summary": [],44          "moderator": false,45          "admin": false,46          "staff": false,47          "user_id": 48975,48          "hidden": false,49          "trust_level": 0,50          "deleted_at": null,51          "user_deleted": false,52          "edit_reason": null,53          "can_view_edit_history": true,54          "wiki": false,55          "post_url": "/t/one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation-for-this-specific-piece-of-code/131848/1",56          "can_accept_answer": false,57          "can_unaccept_answer": false,58          "accepted_answer": false,59          "topic_accepted_answer": true,60          "can_vote": false61        },62        {63          "id": 306623,64          "name": "",65          "username": "Sayed_Nadim",66          "avatar_template": "/user_avatar/discuss.pytorch.org/sayed_nadim/{size}/34051_2.png",67          "created_at": "2021-09-13T13:20:15.460Z",68          "cooked": "<p>Hi,<br>\nCan you train the generator first and then the discriminator? The discriminator seems to detach the output from graph for loss calculations.</p>",69          "post_number": 2,70          "post_type": 1,71          "posts_count": 3,72          "updated_at": "2021-09-13T14:07:21.381Z",73          "reply_count": 1,74          "reply_to_post_number": null,75          "quote_count": 0,76          "incoming_link_count": 1,77          "reads": 4,78          "readers_count": 3,79          "score": 10.8,80          "yours": false,81          "topic_id": 131848,82          "topic_slug": "one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation-for-this-specific-piece-of-code",83          "display_username": "",84          "primary_group_name": null,85          "flair_name": null,86          "flair_url": null,87          "flair_bg_color": null,88          "flair_color": null,89          "flair_group_id": null,90          "badges_granted": [],91          "version": 1,92          "can_edit": false,93          "can_delete": false,94          "can_recover": false,95          "can_see_hidden_post": false,96          "can_wiki": false,97          "read": true,98          "user_title": "",99          "bookmarked": false,100          "actions_summary": [],101          "moderator": false,102          "admin": false,103          "staff": false,104          "user_id": 27175,105          "hidden": false,106          "trust_level": 2,107          "deleted_at": null,108          "user_deleted": false,109          "edit_reason": null,110          "can_view_edit_history": true,111          "wiki": false,112          "post_url": "/t/one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation-for-this-specific-piece-of-code/131848/2",113          "can_accept_answer": false,114          "can_unaccept_answer": false,115          "accepted_answer": true,116          "topic_accepted_answer": true117        },118        {119          "id": 306635,120          "name": "Linux Penguin",121          "username": "Linux_Penguin",122          "avatar_template": "/user_avatar/discuss.pytorch.org/linux_penguin/{size}/34659_2.png",123          "created_at": "2021-09-13T14:08:40.906Z",124          "cooked": "<p>Thank you for the solution!</p>",125          "post_number": 4,126          "post_type": 1,127          "posts_count": 3,128          "updated_at": "2021-09-13T14:08:40.906Z",129          "reply_count": 0,130          "reply_to_post_number": 2,131          "quote_count": 0,132          "incoming_link_count": 1,133          "reads": 4,134          "readers_count": 3,135          "score": 20.8,136          "yours": false,137          "topic_id": 131848,138          "topic_slug": "one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation-for-this-specific-piece-of-code",139          "display_username": "Linux Penguin",140          "primary_group_name": null,141          "flair_name": null,142          "flair_url": null,143          "flair_bg_color": null,144          "flair_color": null,145          "flair_group_id": null,146          "badges_granted": [],147          "version": 1,148          "can_edit": false,149          "can_delete": false,150          "can_recover": false,151          "can_see_hidden_post": false,152          "can_wiki": false,153          "read": true,154          "user_title": null,155          "reply_to_user": {156            "id": 27175,157            "username": "Sayed_Nadim",158            "name": "",159            "avatar_template": "/user_avatar/discuss.pytorch.org/sayed_nadim/{size}/34051_2.png"160          },161          "bookmarked": false,162          "actions_summary": [163            {164              "id": 2,165              "count": 1166            }167          ],168          "moderator": false,169          "admin": false,170          "staff": false,171          "user_id": 48975,172          "hidden": false,173          "trust_level": 0,174          "deleted_at": null,175          "user_deleted": false,176          "edit_reason": null,177          "can_view_edit_history": true,178          "wiki": false,179          "post_url": "/t/one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation-for-this-specific-piece-of-code/131848/4",180          "can_accept_answer": false,181          "can_unaccept_answer": false,182          "accepted_answer": false,183          "topic_accepted_answer": true184        }185      ],186      "stream": [187        306615,188        306623,189        306635190      ]191    },192    "timeline_lookup": [193      [194        1,195        1503196      ]197    ],198    "suggested_topics": [199      {200        "fancy_title": "Autograd process isn&rsquo;t available when I profile via torch.profiler",201        "id": 219049,202        "title": "Autograd process isn't available when I profile via torch.profiler",203        "slug": "autograd-process-isnt-available-when-i-profile-via-torch-profiler",204        "posts_count": 4,205        "reply_count": 2,206        "highest_post_number": 4,207        "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/7/a/7adb1cfe80dc25bff8bd335c9fa43f090bfd0e5a_2_1024x474.png",208        "created_at": "2025-04-14T07:37:11.996Z",209        "last_posted_at": "2025-04-15T15:33:22.023Z",210        "bumped": true,211        "bumped_at": "2025-04-15T15:33:22.023Z",212        "archetype": "regular",213        "unseen": false,214        "pinned": false,215        "unpinned": null,216        "visible": true,217        "closed": false,218        "archived": false,219        "bookmarked": null,220        "liked": null,221        "tags_descriptions": {},222        "like_count": 0,223        "views": 44,224        "category_id": 7,225        "featured_link": null,226        "has_accepted_answer": false,227        "posters": [228          {229            "extras": null,230            "description": "Original Poster",231            "user": {232              "id": 83712,233              "username": "joshkim",234              "name": null,235              "avatar_template": "/letter_avatar_proxy/v4/letter/j/a8b319/{size}.png",236              "trust_level": 1237            }238          },239          {240            "extras": "latest",241            "description": "Most Recent Poster",242            "user": {243              "id": 3534,244              "username": "ptrblck",245              "name": "",246              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",247              "admin": true,248              "moderator": true,249              "trust_level": 2250            }251          }252        ]253      },254      {255        "fancy_title": "Freezing CNN Channels",256        "id": 216265,257        "title": "Freezing CNN Channels",258        "slug": "freezing-cnn-channels",259        "posts_count": 3,260        "reply_count": 0,261        "highest_post_number": 3,262        "image_url": null,263        "created_at": "2025-02-05T11:04:17.000Z",264        "last_posted_at": "2025-02-07T14:41:56.375Z",265        "bumped": true,266        "bumped_at": "2025-02-07T14:41:56.375Z",267        "archetype": "regular",268        "unseen": false,269        "pinned": false,270        "unpinned": null,271        "visible": true,272        "closed": false,273        "archived": false,274        "bookmarked": null,275        "liked": null,276        "tags_descriptions": {},277        "like_count": 0,278        "views": 184,279        "category_id": 7,280        "featured_link": null,281        "has_accepted_answer": false,282        "posters": [283          {284            "extras": "latest",285            "description": "Original Poster, Most Recent Poster",286            "user": {287              "id": 82501,288              "username": "SudakshK",289              "name": "",290              "avatar_template": "/user_avatar/discuss.pytorch.org/sudakshk/{size}/75478_2.png",291              "trust_level": 1292            }293          },294          {295            "extras": null,296            "description": "Frequent Poster",297            "user": {298              "id": 19553,299              "username": "anantguptadbl",300              "name": "Anant Gupta",301              "avatar_template": "/user_avatar/discuss.pytorch.org/anantguptadbl/{size}/17784_2.png",302              "trust_level": 2303            }304          }305        ]306      },307      {308        "fancy_title": "Can I split my input in multiple embeddings? How would pytorch compute gradients?",309        "id": 212676,310        "title": "Can I split my input in multiple embeddings? How would pytorch compute gradients?",311        "slug": "can-i-split-my-input-in-multiple-embeddings-how-would-pytorch-compute-gradients",312        "posts_count": 2,313        "reply_count": 0,314        "highest_post_number": 2,315        "image_url": null,316        "created_at": "2024-11-08T02:24:12.658Z",317        "last_posted_at": "2024-11-08T04:07:54.481Z",318        "bumped": true,319        "bumped_at": "2024-11-08T04:07:54.481Z",320        "archetype": "regular",321        "unseen": false,322        "pinned": false,323        "unpinned": null,324        "visible": true,325        "closed": false,326        "archived": false,327        "bookmarked": null,328        "liked": null,329        "tags_descriptions": {},330        "like_count": 1,331        "views": 33,332        "category_id": 7,333        "featured_link": null,334        "has_accepted_answer": true,335        "posters": [336          {337            "extras": null,338            "description": "Original Poster",339            "user": {340              "id": 80757,341              "username": "Thomas_J",342              "name": "Thomas J",343              "avatar_template": "/user_avatar/discuss.pytorch.org/thomas_j/{size}/73841_2.png",344              "trust_level": 1345            }346          },347          {348            "extras": "latest",349            "description": "Most Recent Poster, Accepted Answer",350            "user": {351              "id": 3534,352              "username": "ptrblck",353              "name": "",354              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",355              "admin": true,356              "moderator": true,357              "trust_level": 2358            }359          }360        ]361      },362      {363        "fancy_title": "Is there a faster way to compute the jacobian than autograd.functional.jacobian?",364        "id": 218647,365        "title": "Is there a faster way to compute the jacobian than autograd.functional.jacobian?",366        "slug": "is-there-a-faster-way-to-compute-the-jacobian-than-autograd-functional-jacobian",367        "posts_count": 5,368        "reply_count": 2,369        "highest_post_number": 5,370        "image_url": null,371        "created_at": "2025-04-05T18:39:29.382Z",372        "last_posted_at": "2025-04-07T18:32:15.810Z",373        "bumped": true,374        "bumped_at": "2025-04-07T18:32:15.810Z",375        "archetype": "regular",376        "unseen": false,377        "pinned": false,378        "unpinned": null,379        "visible": true,380        "closed": false,381        "archived": false,382        "bookmarked": null,383        "liked": null,384        "tags_descriptions": {},385        "like_count": 1,386        "views": 124,387        "category_id": 7,388        "featured_link": null,389        "has_accepted_answer": true,390        "posters": [391          {392            "extras": "latest",393            "description": "Original Poster, Most Recent Poster",394            "user": {395              "id": 83650,396              "username": "Stev1",397              "name": "",398              "avatar_template": "/letter_avatar_proxy/v4/letter/s/7ab992/{size}.png",399              "trust_level": 1400            }401          },402          {403            "extras": null,404            "description": "Frequent Poster, Accepted Answer",405            "user": {406              "id": 18088,407              "username": "KFrank",408              "name": "K. Frank",409              "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",410              "trust_level": 2411            }412          }413        ]414      },415      {416        "fancy_title": "Gradient of Tensor is Zero",417        "id": 219509,418        "title": "Gradient of Tensor is Zero",419        "slug": "gradient-of-tensor-is-zero",420        "posts_count": 5,421        "reply_count": 2,422        "highest_post_number": 5,423        "image_url": null,424        "created_at": "2025-04-27T13:44:12.596Z",425        "last_posted_at": "2025-04-28T10:45:20.561Z",426        "bumped": true,427        "bumped_at": "2025-04-28T14:34:19.181Z",428        "archetype": "regular",429        "unseen": false,430        "pinned": false,431        "unpinned": null,432        "visible": true,433        "closed": false,434        "archived": false,435        "bookmarked": null,436        "liked": null,437        "tags_descriptions": {},438        "like_count": 0,439        "views": 150,440        "category_id": 7,441        "featured_link": null,442        "has_accepted_answer": false,443        "posters": [444          {445            "extras": "latest",446            "description": "Original Poster, Most Recent Poster",447            "user": {448              "id": 84036,449              "username": "Amosen",450              "name": null,451              "avatar_template": "/letter_avatar_proxy/v4/letter/a/9fc348/{size}.png",452              "trust_level": 0453            }454          },455          {456            "extras": null,457            "description": "Frequent Poster",458            "user": {459              "id": 18088,460              "username": "KFrank",461              "name": "K. Frank",462              "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",463              "trust_level": 2464            }465          }466        ]467      }468    ],469    "tags_descriptions": {},470    "fancy_title": "One of the variables needed for gradient computation has been modified by an inplace operation for this specific piece of code",471    "id": 131848,472    "title": "One of the variables needed for gradient computation has been modified by an inplace operation for this specific piece of code",473    "posts_count": 3,474    "created_at": "2021-09-13T12:43:56.429Z",475    "views": 405,476    "reply_count": 2,477    "like_count": 1,478    "last_posted_at": "2021-09-13T14:08:40.906Z",479    "visible": true,480    "closed": false,481    "archived": false,482    "has_summary": false,483    "archetype": "regular",484    "slug": "one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation-for-this-specific-piece-of-code",485    "category_id": 7,486    "word_count": 374,487    "deleted_at": null,488    "user_id": 48975,489    "featured_link": null,490    "pinned_globally": false,491    "pinned_at": null,492    "pinned_until": null,493    "image_url": null,494    "slow_mode_seconds": 0,495    "draft": null,496    "draft_key": "topic_131848",497    "draft_sequence": null,498    "unpinned": null,499    "pinned": false,500    "current_post_number": 1,501    "highest_post_number": 4,502    "deleted_by": null,503    "actions_summary": [504      {505        "id": 4,506        "count": 0,507        "hidden": false,508        "can_act": false509      },510      {511        "id": 8,512        "count": 0,513        "hidden": false,514        "can_act": false515      },516      {517        "id": 10,518        "count": 0,519        "hidden": false,520        "can_act": false521      },522      {523        "id": 7,524        "count": 0,525        "hidden": false,526        "can_act": false527      }528    ],529    "chunk_size": 20,530    "bookmarked": false,531    "topic_timer": null,532    "message_bus_last_id": 0,533    "participant_count": 2,534    "show_read_indicator": false,535    "thumbnails": null,536    "slow_mode_enabled_until": null,537    "accepted_answer": {538      "post_number": 2,539      "username": "Sayed_Nadim",540      "name": "",541      "excerpt": "Hi, \nCan you train the generator first and then the discriminator? The discriminator seems to detach the output from graph for loss calculations."542    },543    "can_vote": false,544    "vote_count": 0,545    "user_voted": false,546    "discourse_zendesk_plugin_zendesk_id": null,547    "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",548    "details": {549      "can_edit": false,550      "notification_level": 1,551      "participants": [552        {553          "id": 48975,554          "username": "Linux_Penguin",555          "name": "Linux Penguin",556          "avatar_template": "/user_avatar/discuss.pytorch.org/linux_penguin/{size}/34659_2.png",557          "post_count": 2,558          "primary_group_name": null,559          "flair_name": null,560          "flair_url": null,561          "flair_color": null,562          "flair_bg_color": null,563          "flair_group_id": null,564          "trust_level": 0565        },566        {567          "id": 27175,568          "username": "Sayed_Nadim",569          "name": "",570          "avatar_template": "/user_avatar/discuss.pytorch.org/sayed_nadim/{size}/34051_2.png",571          "post_count": 1,572          "primary_group_name": null,573          "flair_name": null,574          "flair_url": null,575          "flair_color": null,576          "flair_bg_color": null,577          "flair_group_id": null,578          "trust_level": 2579        }580      ],581      "created_by": {582        "id": 48975,583        "username": "Linux_Penguin",584        "name": "Linux Penguin",585        "avatar_template": "/user_avatar/discuss.pytorch.org/linux_penguin/{size}/34659_2.png"586      },587      "last_poster": {588        "id": 48975,589        "username": "Linux_Penguin",590        "name": "Linux Penguin",591        "avatar_template": "/user_avatar/discuss.pytorch.org/linux_penguin/{size}/34659_2.png"592      }593    },594    "bookmarks": []595  },596  {597    "post_stream": {598      "posts": [599        {600          "id": 305274,601          "name": "Marek Wolan",602          "username": "marek-mottmac",603          "avatar_template": "/letter_avatar_proxy/v4/letter/m/e9bcb4/{size}.png",604          "created_at": "2021-09-06T12:56:01.037Z",605          "cooked": "<p>Hi,</p>\n<p>I’m attempting to use Pytorch on a new Windows machine. I can’t seem to get a working pytorch configuration.</p>\n<p>I am using Windows 10 with Nvidia RTX A6000. I have tried several driver versions, cuda versions and pytorch versions in various configurations but I can’t seem to use pytorch.</p>\n<p>I don’t get an error message. Instead, any time I try to send anything to the GPU, the commandline freezes completely and CTRL+C doesn’t stop execution, I have to CTRL+Pause/Break to stop execution. For example the line torch.rand(3,3,device=‘cuda:0’) causes the cmd to hang. (but torch.rand(3,3) works fine)</p>\n<p>My current software versions are:<br>\ngraphics driver version 460.89<br>\nCuda 11.1<br>\npytorch 1.8.2</p>\n<p>torch.cuda.is_available() returns true<br>\ntorch.version.cuda returns 11.1</p>\n<p>Any ideas of what I should try are appreciated.</p>",606          "post_number": 1,607          "post_type": 1,608          "posts_count": 2,609          "updated_at": "2021-09-06T12:56:01.037Z",610          "reply_count": 0,611          "reply_to_post_number": null,612          "quote_count": 0,613          "incoming_link_count": 368,614          "reads": 11,615          "readers_count": 10,616          "score": 1837.2,617          "yours": false,618          "topic_id": 131255,619          "topic_slug": "commandline-hangs-when-trying-to-use-gpu-ctrl-c-doesnt-kill-process",620          "display_username": "Marek Wolan",621          "primary_group_name": null,622          "flair_name": null,623          "flair_url": null,624          "flair_bg_color": null,625          "flair_color": null,626          "flair_group_id": null,627          "badges_granted": [],628          "version": 1,629          "can_edit": false,630          "can_delete": false,631          "can_recover": false,632          "can_see_hidden_post": false,633          "can_wiki": false,634          "read": true,635          "user_title": null,636          "bookmarked": false,637          "actions_summary": [],638          "moderator": false,639          "admin": false,640          "staff": false,641          "user_id": 48780,642          "hidden": false,643          "trust_level": 1,644          "deleted_at": null,645          "user_deleted": false,646          "edit_reason": null,647          "can_view_edit_history": true,648          "wiki": false,649          "post_url": "/t/commandline-hangs-when-trying-to-use-gpu-ctrl-c-doesnt-kill-process/131255/1",650          "can_accept_answer": false,651          "can_unaccept_answer": false,652          "accepted_answer": false,653          "topic_accepted_answer": null,654          "can_vote": false655        },656        {657          "id": 306619,658          "name": "Marek Wolan",659          "username": "marek-mottmac",660          "avatar_template": "/letter_avatar_proxy/v4/letter/m/e9bcb4/{size}.png",661          "created_at": "2021-09-13T13:02:25.981Z",662          "cooked": "<p>Hello, I’ve solved my issue and it was caused by the Windows power performance being set to ‘power saving’. Switching it to ‘high performance’ has allowed me to use pytorch normally.</p>\n<p><img src=\"https://discuss.pytorch.org/images/emoji/apple/upside_down_face.png?v=10\" title=\":upside_down_face:\" class=\"emoji only-emoji\" alt=\":upside_down_face:\"></p>",663          "post_number": 2,664          "post_type": 1,665          "posts_count": 2,666          "updated_at": "2021-09-13T13:02:25.981Z",667          "reply_count": 0,668          "reply_to_post_number": null,669          "quote_count": 0,670          "incoming_link_count": 7,671          "reads": 6,672          "readers_count": 5,673          "score": 36.2,674          "yours": false,675          "topic_id": 131255,676          "topic_slug": "commandline-hangs-when-trying-to-use-gpu-ctrl-c-doesnt-kill-process",677          "display_username": "Marek Wolan",678          "primary_group_name": null,679          "flair_name": null,680          "flair_url": null,681          "flair_bg_color": null,682          "flair_color": null,683          "flair_group_id": null,684          "badges_granted": [],685          "version": 1,686          "can_edit": false,687          "can_delete": false,688          "can_recover": false,689          "can_see_hidden_post": false,690          "can_wiki": false,691          "read": true,692          "user_title": null,693          "bookmarked": false,694          "actions_summary": [],695          "moderator": false,696          "admin": false,697          "staff": false,698          "user_id": 48780,699          "hidden": false,700          "trust_level": 1,701          "deleted_at": null,702          "user_deleted": false,703          "edit_reason": null,704          "can_view_edit_history": true,705          "wiki": false,706          "post_url": "/t/commandline-hangs-when-trying-to-use-gpu-ctrl-c-doesnt-kill-process/131255/2",707          "can_accept_answer": false,708          "can_unaccept_answer": false,709          "accepted_answer": false,710          "topic_accepted_answer": null711        }712      ],713      "stream": [714        305274,715        306619716      ]717    },718    "timeline_lookup": [719      [720        1,721        1510722      ],723      [724        2,725        1503726      ]727    ],728    "suggested_topics": [729      {730        "fancy_title": "How to use torch with CUDA 12.9",731        "id": 220827,732        "title": "How to use torch with CUDA 12.9",733        "slug": "how-to-use-torch-with-cuda-12-9",734        "posts_count": 5,735        "reply_count": 2,736        "highest_post_number": 7,737        "image_url": null,738        "created_at": "2025-06-15T07:08:55.857Z",739        "last_posted_at": "2025-07-18T22:41:59.447Z",740        "bumped": true,741        "bumped_at": "2025-07-18T22:41:59.447Z",742        "archetype": "regular",743        "unseen": false,744        "pinned": false,745        "unpinned": null,746        "visible": true,747        "closed": false,748        "archived": false,749        "bookmarked": null,750        "liked": null,751        "tags_descriptions": {},752        "like_count": 3,753        "views": 7526,754        "category_id": 26,755        "featured_link": null,756        "has_accepted_answer": false,757        "posters": [758          {759            "extras": null,760            "description": "Original Poster",761            "user": {762              "id": 84711,763              "username": "Ahmed_Mhmouad",764              "name": "Ahmed Mhmouad",765              "avatar_template": "/user_avatar/discuss.pytorch.org/ahmed_mhmouad/{size}/77381_2.png",766              "trust_level": 0767            }768          },769          {770            "extras": null,771            "description": "Frequent Poster",772            "user": {773              "id": 3534,774              "username": "ptrblck",775              "name": "",776              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",777              "admin": true,778              "moderator": true,779              "trust_level": 2780            }781          },782          {783            "extras": null,784            "description": "Frequent Poster",785            "user": {786              "id": 85105,787              "username": "yogesh_jog",788              "name": "yogesh jog",789              "avatar_template": "/user_avatar/discuss.pytorch.org/yogesh_jog/{size}/77689_2.png",790              "trust_level": 0791            }792          },793          {794            "extras": "latest",795            "description": "Most Recent Poster",796            "user": {797              "id": 85150,798              "username": "HipHop_Delhi",799              "name": "HipHop Delhi",800              "avatar_template": "/user_avatar/discuss.pytorch.org/hiphop_delhi/{size}/77724_2.png",801              "trust_level": 0802            }803          }804        ]805      },806      {807        "fancy_title": "How Do I use Pytorch with RTX 5060 Ti",808        "id": 220926,809        "title": "How Do I use Pytorch with RTX 5060 Ti",810        "slug": "how-do-i-use-pytorch-with-rtx-5060-ti",811        "posts_count": 15,812        "reply_count": 9,813        "highest_post_number": 15,814        "image_url": null,815        "created_at": "2025-06-19T21:04:25.604Z",816        "last_posted_at": "2025-10-19T13:36:08.195Z",817        "bumped": true,818        "bumped_at": "2025-10-19T13:36:08.195Z",819        "archetype": "regular",820        "unseen": false,821        "pinned": false,822        "unpinned": null,823        "visible": true,824        "closed": false,825        "archived": false,826        "bookmarked": null,827        "liked": null,828        "tags_descriptions": {},829        "like_count": 2,830        "views": 4924,831        "category_id": 26,832        "featured_link": null,833        "has_accepted_answer": false,834        "posters": [835          {836            "extras": null,837            "description": "Original Poster",838            "user": {839              "id": 84658,840              "username": "Jeff_H",841              "name": "Jeff H",842              "avatar_template": "/user_avatar/discuss.pytorch.org/jeff_h/{size}/77338_2.png",843              "trust_level": 1844            }845          },846          {847            "extras": null,848            "description": "Frequent Poster",849            "user": {850              "id": 84869,851              "username": "Roosri_test",852              "name": "Roosri Test",853              "avatar_template": "/user_avatar/discuss.pytorch.org/roosri_test/{size}/77523_2.png",854              "trust_level": 0855            }856          },857          {858            "extras": null,859            "description": "Frequent Poster",860            "user": {861              "id": 85007,862              "username": "Jack_Baqir",863              "name": "Jack Baqir",864              "avatar_template": "/user_avatar/discuss.pytorch.org/jack_baqir/{size}/75220_2.png",865              "trust_level": 0866            }867          },868          {869            "extras": null,870            "description": "Frequent Poster",871            "user": {872              "id": 86131,873              "username": "mia2",874              "name": "",875              "avatar_template": "/letter_avatar_proxy/v4/letter/m/47e85d/{size}.png",876              "trust_level": 1877            }878          },879          {880            "extras": "latest",881            "description": "Most Recent Poster",882            "user": {883              "id": 86223,884              "username": "cfoster1111",885              "name": "Cfoster1111",886              "avatar_template": "/user_avatar/discuss.pytorch.org/cfoster1111/{size}/78477_2.png",887              "trust_level": 0888            }889          }890        ]891      },892      {893        "fancy_title": "Windows Debug Build GIL Error When Importing Torch",894        "id": 216021,895        "title": "Windows Debug Build GIL Error When Importing Torch",896        "slug": "windows-debug-build-gil-error-when-importing-torch",897        "posts_count": 2,898        "reply_count": 0,899        "highest_post_number": 2,900        "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/5/8/58506a5d14f3b120e566a3f7a5dbff31bc334bdf.png",901        "created_at": "2025-01-29T10:43:35.884Z",902        "last_posted_at": "2025-05-25T17:08:10.672Z",903        "bumped": true,904        "bumped_at": "2025-05-25T17:08:10.672Z",905        "archetype": "regular",906        "unseen": false,907        "pinned": false,908        "unpinned": null,909        "visible": true,910        "closed": false,911        "archived": false,912        "bookmarked": null,913        "liked": null,914        "tags_descriptions": {},915        "like_count": 0,916        "views": 108,917        "category_id": 26,918        "featured_link": null,919        "has_accepted_answer": false,920        "posters": [921          {922            "extras": null,923            "description": "Original Poster",924            "user": {925              "id": 82367,926              "username": "ikalinic",927              "name": "Ilija Kalinić",928              "avatar_template": "/user_avatar/discuss.pytorch.org/ikalinic/{size}/75354_2.png",929              "trust_level": 1930            }931          },932          {933            "extras": "latest",934            "description": "Most Recent Poster",935            "user": {936              "id": 84447,937              "username": "charlesxsh",938              "name": "Shihao Xia",939              "avatar_template": "/user_avatar/discuss.pytorch.org/charlesxsh/{size}/77160_2.png",940              "trust_level": 0941            }942          }943        ]944      },945      {946        "fancy_title": "Identifying if gpu cores are used",947        "id": 216872,948        "title": "Identifying if gpu cores are used",949        "slug": "identifying-if-gpu-cores-are-used",950        "posts_count": 3,951        "reply_count": 0,952        "highest_post_number": 4,953        "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/e/8/e89b25fc8d05172dff54f38fd989c9bea1b386ab_2_1024x545.png",954        "created_at": "2025-02-19T07:45:24.715Z",955        "last_posted_at": "2025-05-06T13:32:31.627Z",956        "bumped": true,957        "bumped_at": "2025-05-06T13:32:31.627Z",958        "archetype": "regular",959        "unseen": false,960        "pinned": false,961        "unpinned": null,962        "visible": true,963        "closed": false,964        "archived": false,965        "bookmarked": null,966        "liked": null,967        "tags_descriptions": {},968        "like_count": 0,969        "views": 204,970        "category_id": 26,971        "featured_link": null,972        "has_accepted_answer": false,973        "posters": [974          {975            "extras": null,976            "description": "Original Poster",977            "user": {978              "id": 71824,979              "username": "Stephane_Ancelot",980              "name": "Stéphane Ancelot",981              "avatar_template": "/user_avatar/discuss.pytorch.org/stephane_ancelot/{size}/61201_2.png",982              "trust_level": 1983            }984          },985          {986            "extras": null,987            "description": "Frequent Poster",988            "user": {989              "id": 3534,990              "username": "ptrblck",991              "name": "",992              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",993              "admin": true,994              "moderator": true,995              "trust_level": 2996            }997          },998          {999            "extras": "latest",1000            "description": "Most Recent Poster",1001            "user": {1002              "id": 84077,1003              "username": "python",1004              "name": null,1005              "avatar_template": "/letter_avatar_proxy/v4/letter/p/ee7513/{size}.png",1006              "trust_level": 11007            }1008          }1009        ]1010      },1011      {1012        "fancy_title": "How am i supposed to get old versions of torch on windows x64 arhitecture?",1013        "id": 222813,1014        "title": "How am i supposed to get old versions of torch on windows x64 arhitecture?",1015        "slug": "how-am-i-supposed-to-get-old-versions-of-torch-on-windows-x64-arhitecture",1016        "posts_count": 3,1017        "reply_count": 1,1018        "highest_post_number": 3,1019        "image_url": null,1020        "created_at": "2025-09-02T00:37:13.338Z",1021        "last_posted_at": "2025-09-05T09:36:12.011Z",1022        "bumped": true,1023        "bumped_at": "2025-09-05T09:36:12.011Z",1024        "archetype": "regular",1025        "unseen": false,1026        "pinned": false,1027        "unpinned": null,1028        "visible": true,1029        "closed": false,1030        "archived": false,1031        "bookmarked": null,1032        "liked": null,1033        "tags_descriptions": {},1034        "like_count": 0,1035        "views": 35,1036        "category_id": 26,1037        "featured_link": null,1038        "has_accepted_answer": false,1039        "posters": [1040          {1041            "extras": "latest",1042            "description": "Original Poster, Most Recent Poster",1043            "user": {1044              "id": 85715,1045              "username": "Alex_Eugen_Botez",1046              "name": "Alex Eugen Botez",1047              "avatar_template": "/user_avatar/discuss.pytorch.org/alex_eugen_botez/{size}/75235_2.png",1048              "trust_level": 01049            }1050          },1051          {1052            "extras": null,1053            "description": "Frequent Poster",1054            "user": {1055              "id": 3534,1056              "username": "ptrblck",1057              "name": "",1058              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1059              "admin": true,1060              "moderator": true,1061              "trust_level": 21062            }1063          }1064        ]1065      }1066    ],1067    "tags_descriptions": {},1068    "fancy_title": "Commandline hangs when trying to use GPU (CTRL+C doesn&rsquo;t kill process)",1069    "id": 131255,1070    "title": "Commandline hangs when trying to use GPU (CTRL+C doesn't kill process)",1071    "posts_count": 2,1072    "created_at": "2021-09-06T12:56:00.962Z",1073    "views": 1036,1074    "reply_count": 0,1075    "like_count": 0,1076    "last_posted_at": "2021-09-13T13:02:25.981Z",1077    "visible": true,1078    "closed": false,1079    "archived": false,1080    "has_summary": false,1081    "archetype": "regular",1082    "slug": "commandline-hangs-when-trying-to-use-gpu-ctrl-c-doesnt-kill-process",1083    "category_id": 26,1084    "word_count": 184,1085    "deleted_at": null,1086    "user_id": 48780,1087    "featured_link": null,1088    "pinned_globally": false,1089    "pinned_at": null,1090    "pinned_until": null,1091    "image_url": null,1092    "slow_mode_seconds": 0,1093    "draft": null,1094    "draft_key": "topic_131255",1095    "draft_sequence": null,1096    "unpinned": null,1097    "pinned": false,1098    "current_post_number": 1,1099    "highest_post_number": 2,1100    "deleted_by": null,1101    "actions_summary": [1102      {1103        "id": 4,1104        "count": 0,1105        "hidden": false,1106        "can_act": false1107      },1108      {1109        "id": 8,1110        "count": 0,1111        "hidden": false,1112        "can_act": false1113      },1114      {1115        "id": 10,1116        "count": 0,1117        "hidden": false,1118        "can_act": false1119      },1120      {1121        "id": 7,1122        "count": 0,1123        "hidden": false,1124        "can_act": false1125      }1126    ],1127    "chunk_size": 20,1128    "bookmarked": false,1129    "topic_timer": null,1130    "message_bus_last_id": 0,1131    "participant_count": 1,1132    "show_read_indicator": false,1133    "thumbnails": null,1134    "slow_mode_enabled_until": null,1135    "can_vote": false,1136    "vote_count": 0,1137    "user_voted": false,1138    "discourse_zendesk_plugin_zendesk_id": null,1139    "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1140    "details": {1141      "can_edit": false,1142      "notification_level": 1,1143      "participants": [1144        {1145          "id": 48780,1146          "username": "marek-mottmac",1147          "name": "Marek Wolan",1148          "avatar_template": "/letter_avatar_proxy/v4/letter/m/e9bcb4/{size}.png",1149          "post_count": 2,1150          "primary_group_name": null,1151          "flair_name": null,1152          "flair_url": null,1153          "flair_color": null,1154          "flair_bg_color": null,1155          "flair_group_id": null,1156          "trust_level": 11157        }1158      ],1159      "created_by": {1160        "id": 48780,1161        "username": "marek-mottmac",1162        "name": "Marek Wolan",1163        "avatar_template": "/letter_avatar_proxy/v4/letter/m/e9bcb4/{size}.png"1164      },1165      "last_poster": {1166        "id": 48780,1167        "username": "marek-mottmac",1168        "name": "Marek Wolan",1169        "avatar_template": "/letter_avatar_proxy/v4/letter/m/e9bcb4/{size}.png"1170      }1171    },1172    "bookmarks": []1173  },1174  {1175    "post_stream": {1176      "posts": [1177        {1178          "id": 306604,1179          "name": "Vishal Jain",1180          "username": "Vishal_Jain1",1181          "avatar_template": "/user_avatar/discuss.pytorch.org/vishal_jain1/{size}/29898_2.png",1182          "created_at": "2021-09-13T10:12:24.185Z",1183          "cooked": "<p>Ive implemented a new loss function that tries to measure the circularity of a segmentation based on image moments. Ive combined this with the dice loss so my new loss is:<br>\nL = dice_loss + log10(circ_loss)/3 + 1</p>\n<p>When printing the variables L, dice_loss and circ_loss in the above I noticed that the circ_loss term had no grad_fn attribute.</p>\n<p>I’ve got very little knowledge as to what this means, but I am worried this means backward prop is not taking into account the circ loss term. There is no error during training and the overall loss seems to be decreasing, but I’m just wondering what the lack of a grad fn attribute means.</p>\n<p>Can provide any code that could be helpful.</p>\n<p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://discuss.pytorch.org/uploads/default/original/3X/2/7/27af41475ea87de1f2d3bd02a0fab0b4b340ab2d.png\" data-download-href=\"https://discuss.pytorch.org/uploads/default/27af41475ea87de1f2d3bd02a0fab0b4b340ab2d\" title=\"image\"><img src=\"https://discuss.pytorch.org/uploads/default/optimized/3X/2/7/27af41475ea87de1f2d3bd02a0fab0b4b340ab2d_2_690x49.png\" alt=\"image\" data-base62-sha1=\"5F46pDoYs3oXgpSNUTmojFWpxpz\" width=\"690\" height=\"49\" srcset=\"https://discuss.pytorch.org/uploads/default/optimized/3X/2/7/27af41475ea87de1f2d3bd02a0fab0b4b340ab2d_2_690x49.png, https://discuss.pytorch.org/uploads/default/optimized/3X/2/7/27af41475ea87de1f2d3bd02a0fab0b4b340ab2d_2_1035x73.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/7/27af41475ea87de1f2d3bd02a0fab0b4b340ab2d_2_1380x98.png 2x\" data-dominant-color=\"060707\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">2772×200 42.1 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p>\n<p>EDIT:<br>\nAdding requires_grad = true during initalisation of leaf tensors worked to bring the grad_fn attribute. So code does not have the issue detailed in the question. Not sure how to close question.</p>",1184          "post_number": 1,1185          "post_type": 1,1186          "posts_count": 3,1187          "updated_at": "2021-09-13T13:24:09.292Z",1188          "reply_count": 0,1189          "reply_to_post_number": null,1190          "quote_count": 0,1191          "incoming_link_count": 137,1192          "reads": 11,1193          "readers_count": 10,1194          "score": 682.0,1195          "yours": false,1196          "topic_id": 131839,1197          "topic_slug": "no-grad-fn-attribute-for-custom-loss-term",1198          "display_username": "Vishal Jain",1199          "primary_group_name": null,1200          "flair_name": null,

Showing the first 1,200 of 62887 lines. Download the file for the rest.