Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 367064,7 "name": "Simone Cancelli",8 "username": "SimCan",9 "avatar_template": "/user_avatar/discuss.pytorch.org/simcan/{size}/48222_2.png",10 "created_at": "2022-09-21T09:37:52.840Z",11 "cooked": "<p>I would like to know why I get this error using <code>CrossEntropyLoss()</code> for the semantic segmentation task.<br>\nInputs have shape <code>[B, C, W, H]</code>, and targets have shape <code>[B, W, H]</code>.<br>\nTarget is <em>not</em> one-hot encoded.</p>\n<p><strong>Error</strong>:</p>\n<pre><code class=\"lang-auto\"> 3012 if size_average is not None or reduce is not None:\n 3013 reduction = _Reduction.legacy_get_string(size_average, reduce)\n-> 3014 return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)\n 3015 \n 3016 \n\nRuntimeError: 0D or 1D target tensor expected, multi-target not supported\n</code></pre>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 3,15 "updated_at": "2022-09-21T09:37:52.840Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 92,20 "reads": 4,21 "readers_count": 3,22 "score": 460.8,23 "yours": false,24 "topic_id": 161870,25 "topic_slug": "semantic-segmentation-error-0d-or-1d-target-tensor-expected-multi-target-not-supported",26 "display_username": "Simone Cancelli",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": 54630,48 "hidden": false,49 "trust_level": 1,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/semantic-segmentation-error-0d-or-1d-target-tensor-expected-multi-target-not-supported/161870/1",56 "can_accept_answer": false,57 "can_unaccept_answer": false,58 "accepted_answer": false,59 "topic_accepted_answer": null,60 "can_vote": false61 },62 {63 "id": 367066,64 "name": "",65 "username": "ptrblck",66 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",67 "created_at": "2022-09-21T09:46:44.733Z",68 "cooked": "<p>I guess your model output has another shape than reported here, as your shapes would work:</p>\n<pre><code class=\"lang-python\">B, C, H, W = 2, 3, 4, 4\n\noutput = torch.randn(B, C, H, W, requires_grad=True)\ntarget = torch.randint(0, C-1, (B, H, W))\n\ncriterion = nn.CrossEntropyLoss()\nloss = criterion(output, target) # works\n\noutput = torch.randn(B, C)\nloss = criterion(output, target)\n# RuntimeError: 0D or 1D target tensor expected, multi-target not supported\n</code></pre>",69 "post_number": 2,70 "post_type": 1,71 "posts_count": 3,72 "updated_at": "2022-09-21T09:46:44.733Z",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": 25.8,80 "yours": false,81 "topic_id": 161870,82 "topic_slug": "semantic-segmentation-error-0d-or-1d-target-tensor-expected-multi-target-not-supported",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 {102 "id": 2,103 "count": 1104 }105 ],106 "moderator": true,107 "admin": true,108 "staff": true,109 "user_id": 3534,110 "hidden": false,111 "trust_level": 2,112 "deleted_at": null,113 "user_deleted": false,114 "edit_reason": null,115 "can_view_edit_history": true,116 "wiki": false,117 "post_url": "/t/semantic-segmentation-error-0d-or-1d-target-tensor-expected-multi-target-not-supported/161870/2",118 "can_accept_answer": false,119 "can_unaccept_answer": false,120 "accepted_answer": false,121 "topic_accepted_answer": null122 },123 {124 "id": 367474,125 "name": "Simone Cancelli",126 "username": "SimCan",127 "avatar_template": "/user_avatar/discuss.pytorch.org/simcan/{size}/48222_2.png",128 "created_at": "2022-09-24T08:42:16.617Z",129 "cooked": "<p>I double-checked the model output and it has shape [B, C, H, W], in my case [2, 3, 256, 256].<br>\nThe “target” instead previously had shape [B, C, H, W], after I applied <code>torch.squeeze(dim=1)</code>, it has shape [B, H, W] → [2, 256, 256]<br>\nI still do not understand why I get that kind of error</p>",130 "post_number": 3,131 "post_type": 1,132 "posts_count": 3,133 "updated_at": "2022-09-24T10:31:14.939Z",134 "reply_count": 0,135 "reply_to_post_number": 2,136 "quote_count": 0,137 "incoming_link_count": 1,138 "reads": 3,139 "readers_count": 2,140 "score": 5.6,141 "yours": false,142 "topic_id": 161870,143 "topic_slug": "semantic-segmentation-error-0d-or-1d-target-tensor-expected-multi-target-not-supported",144 "display_username": "Simone Cancelli",145 "primary_group_name": null,146 "flair_name": null,147 "flair_url": null,148 "flair_bg_color": null,149 "flair_color": null,150 "flair_group_id": null,151 "badges_granted": [],152 "version": 2,153 "can_edit": false,154 "can_delete": false,155 "can_recover": false,156 "can_see_hidden_post": false,157 "can_wiki": false,158 "read": true,159 "user_title": null,160 "reply_to_user": {161 "id": 3534,162 "username": "ptrblck",163 "name": "",164 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"165 },166 "bookmarked": false,167 "actions_summary": [],168 "moderator": false,169 "admin": false,170 "staff": false,171 "user_id": 54630,172 "hidden": false,173 "trust_level": 1,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/semantic-segmentation-error-0d-or-1d-target-tensor-expected-multi-target-not-supported/161870/3",180 "can_accept_answer": false,181 "can_unaccept_answer": false,182 "accepted_answer": false,183 "topic_accepted_answer": null184 }185 ],186 "stream": [187 367064,188 367066,189 367474190 ]191 },192 "timeline_lookup": [193 [194 1,195 1130196 ],197 [198 3,199 1127200 ]201 ],202 "suggested_topics": [203 {204 "fancy_title": "How to implement pytorchvideo from input as images",205 "id": 215938,206 "title": "How to implement pytorchvideo from input as images",207 "slug": "how-to-implement-pytorchvideo-from-input-as-images",208 "posts_count": 1,209 "reply_count": 0,210 "highest_post_number": 1,211 "image_url": null,212 "created_at": "2025-01-27T14:58:17.998Z",213 "last_posted_at": "2025-01-27T14:58:18.042Z",214 "bumped": true,215 "bumped_at": "2025-01-27T15:02:57.679Z",216 "archetype": "regular",217 "unseen": false,218 "pinned": false,219 "unpinned": null,220 "visible": true,221 "closed": false,222 "archived": false,223 "bookmarked": null,224 "liked": null,225 "tags_descriptions": {},226 "like_count": 0,227 "views": 56,228 "category_id": 5,229 "featured_link": null,230 "has_accepted_answer": false,231 "posters": [232 {233 "extras": "latest single",234 "description": "Original Poster, Most Recent Poster",235 "user": {236 "id": 82344,237 "username": "trungnb34",238 "name": "",239 "avatar_template": "/letter_avatar_proxy/v4/letter/t/ecb155/{size}.png",240 "trust_level": 0241 }242 }243 ]244 },245 {246 "fancy_title": "Fixing number of filters in Conv2ds",247 "id": 214033,248 "title": "Fixing number of filters in Conv2ds",249 "slug": "fixing-number-of-filters-in-conv2ds",250 "posts_count": 4,251 "reply_count": 0,252 "highest_post_number": 4,253 "image_url": null,254 "created_at": "2024-12-10T07:27:04.845Z",255 "last_posted_at": "2024-12-11T04:37:44.049Z",256 "bumped": true,257 "bumped_at": "2024-12-11T04:37:44.049Z",258 "archetype": "regular",259 "unseen": false,260 "pinned": false,261 "unpinned": null,262 "visible": true,263 "closed": false,264 "archived": false,265 "bookmarked": null,266 "liked": null,267 "tags_descriptions": {},268 "like_count": 0,269 "views": 187,270 "category_id": 5,271 "featured_link": null,272 "has_accepted_answer": false,273 "posters": [274 {275 "extras": "latest",276 "description": "Original Poster, Most Recent Poster",277 "user": {278 "id": 81422,279 "username": "Idrees11",280 "name": "Idrees Bhat",281 "avatar_template": "/user_avatar/discuss.pytorch.org/idrees11/{size}/74448_2.png",282 "trust_level": 1283 }284 },285 {286 "extras": null,287 "description": "Frequent Poster",288 "user": {289 "id": 81089,290 "username": "Aknw_Fen",291 "name": "Aknw Fen",292 "avatar_template": "/user_avatar/discuss.pytorch.org/aknw_fen/{size}/74156_2.png",293 "trust_level": 2294 }295 }296 ]297 },298 {299 "fancy_title": "CNN Model is not learning after some epochs",300 "id": 215485,301 "title": "CNN Model is not learning after some epochs",302 "slug": "cnn-model-is-not-learning-after-some-epochs",303 "posts_count": 5,304 "reply_count": 3,305 "highest_post_number": 5,306 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/6/c/6cf1deea54130767dd867db4827e1505ce26e24b_2_1024x817.jpeg",307 "created_at": "2025-01-16T17:42:58.865Z",308 "last_posted_at": "2025-01-17T15:02:23.101Z",309 "bumped": true,310 "bumped_at": "2025-01-17T15:02:23.101Z",311 "archetype": "regular",312 "unseen": false,313 "pinned": false,314 "unpinned": null,315 "visible": true,316 "closed": false,317 "archived": false,318 "bookmarked": null,319 "liked": null,320 "tags_descriptions": {},321 "like_count": 1,322 "views": 170,323 "category_id": 5,324 "featured_link": null,325 "has_accepted_answer": false,326 "posters": [327 {328 "extras": "latest",329 "description": "Original Poster, Most Recent Poster",330 "user": {331 "id": 81840,332 "username": "iran_boy",333 "name": "iran boy",334 "avatar_template": "/user_avatar/discuss.pytorch.org/iran_boy/{size}/74864_2.png",335 "trust_level": 0336 }337 },338 {339 "extras": null,340 "description": "Frequent Poster",341 "user": {342 "id": 77908,343 "username": "mycul",344 "name": "",345 "avatar_template": "/user_avatar/discuss.pytorch.org/mycul/{size}/72394_2.png",346 "trust_level": 2347 }348 }349 ]350 },351 {352 "fancy_title": "Training DataLoader, Loop does not iterate",353 "id": 214803,354 "title": "Training DataLoader, Loop does not iterate",355 "slug": "training-dataloader-loop-does-not-iterate",356 "posts_count": 3,357 "reply_count": 1,358 "highest_post_number": 3,359 "image_url": null,360 "created_at": "2024-12-30T21:47:18.774Z",361 "last_posted_at": "2024-12-31T15:30:38.428Z",362 "bumped": true,363 "bumped_at": "2024-12-31T15:30:38.428Z",364 "archetype": "regular",365 "unseen": false,366 "pinned": false,367 "unpinned": null,368 "visible": true,369 "closed": false,370 "archived": false,371 "bookmarked": null,372 "liked": null,373 "tags_descriptions": {},374 "like_count": 0,375 "views": 153,376 "category_id": 5,377 "featured_link": null,378 "has_accepted_answer": false,379 "posters": [380 {381 "extras": "latest",382 "description": "Original Poster, Most Recent Poster",383 "user": {384 "id": 81797,385 "username": "Diogo_Rodrigues",386 "name": "Diogo Rodrigues",387 "avatar_template": "/user_avatar/discuss.pytorch.org/diogo_rodrigues/{size}/74814_2.png",388 "trust_level": 1389 }390 },391 {392 "extras": null,393 "description": "Frequent Poster",394 "user": {395 "id": 3534,396 "username": "ptrblck",397 "name": "",398 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",399 "admin": true,400 "moderator": true,401 "trust_level": 2402 }403 }404 ]405 },406 {407 "fancy_title": "Looking for realiable pytorch code base finetune stable diffusion",408 "id": 216254,409 "title": "Looking for realiable pytorch code base finetune stable diffusion",410 "slug": "looking-for-realiable-pytorch-code-base-finetune-stable-diffusion",411 "posts_count": 1,412 "reply_count": 0,413 "highest_post_number": 1,414 "image_url": null,415 "created_at": "2025-02-05T07:11:21.881Z",416 "last_posted_at": "2025-02-05T07:11:21.968Z",417 "bumped": true,418 "bumped_at": "2025-02-05T07:11:21.968Z",419 "archetype": "regular",420 "unseen": false,421 "pinned": false,422 "unpinned": null,423 "visible": true,424 "closed": false,425 "archived": false,426 "bookmarked": null,427 "liked": null,428 "tags_descriptions": {},429 "like_count": 0,430 "views": 21,431 "category_id": 5,432 "featured_link": null,433 "has_accepted_answer": false,434 "posters": [435 {436 "extras": "latest single",437 "description": "Original Poster, Most Recent Poster",438 "user": {439 "id": 60459,440 "username": "hiru",441 "name": "Hiru",442 "avatar_template": "/letter_avatar_proxy/v4/letter/h/d2c977/{size}.png",443 "trust_level": 1444 }445 }446 ]447 }448 ],449 "tags_descriptions": {},450 "fancy_title": "Semantic Segmentation - Error: 0D or 1D target tensor expected, multi-target not supported",451 "id": 161870,452 "title": "Semantic Segmentation - Error: 0D or 1D target tensor expected, multi-target not supported",453 "posts_count": 3,454 "created_at": "2022-09-21T09:37:52.755Z",455 "views": 700,456 "reply_count": 1,457 "like_count": 1,458 "last_posted_at": "2022-09-24T08:42:16.617Z",459 "visible": true,460 "closed": false,461 "archived": false,462 "has_summary": false,463 "archetype": "regular",464 "slug": "semantic-segmentation-error-0d-or-1d-target-tensor-expected-multi-target-not-supported",465 "category_id": 5,466 "word_count": 212,467 "deleted_at": null,468 "user_id": 54630,469 "featured_link": null,470 "pinned_globally": false,471 "pinned_at": null,472 "pinned_until": null,473 "image_url": null,474 "slow_mode_seconds": 0,475 "draft": null,476 "draft_key": "topic_161870",477 "draft_sequence": null,478 "unpinned": null,479 "pinned": false,480 "current_post_number": 1,481 "highest_post_number": 3,482 "deleted_by": null,483 "actions_summary": [484 {485 "id": 4,486 "count": 0,487 "hidden": false,488 "can_act": false489 },490 {491 "id": 8,492 "count": 0,493 "hidden": false,494 "can_act": false495 },496 {497 "id": 10,498 "count": 0,499 "hidden": false,500 "can_act": false501 },502 {503 "id": 7,504 "count": 0,505 "hidden": false,506 "can_act": false507 }508 ],509 "chunk_size": 20,510 "bookmarked": false,511 "topic_timer": null,512 "message_bus_last_id": 0,513 "participant_count": 2,514 "show_read_indicator": false,515 "thumbnails": null,516 "slow_mode_enabled_until": null,517 "can_vote": false,518 "vote_count": 0,519 "user_voted": false,520 "discourse_zendesk_plugin_zendesk_id": null,521 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",522 "details": {523 "can_edit": false,524 "notification_level": 1,525 "participants": [526 {527 "id": 54630,528 "username": "SimCan",529 "name": "Simone Cancelli",530 "avatar_template": "/user_avatar/discuss.pytorch.org/simcan/{size}/48222_2.png",531 "post_count": 2,532 "primary_group_name": null,533 "flair_name": null,534 "flair_url": null,535 "flair_color": null,536 "flair_bg_color": null,537 "flair_group_id": null,538 "trust_level": 1539 },540 {541 "id": 3534,542 "username": "ptrblck",543 "name": "",544 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",545 "post_count": 1,546 "primary_group_name": null,547 "flair_name": null,548 "flair_url": null,549 "flair_color": null,550 "flair_bg_color": null,551 "flair_group_id": null,552 "admin": true,553 "moderator": true,554 "trust_level": 2555 }556 ],557 "created_by": {558 "id": 54630,559 "username": "SimCan",560 "name": "Simone Cancelli",561 "avatar_template": "/user_avatar/discuss.pytorch.org/simcan/{size}/48222_2.png"562 },563 "last_poster": {564 "id": 54630,565 "username": "SimCan",566 "name": "Simone Cancelli",567 "avatar_template": "/user_avatar/discuss.pytorch.org/simcan/{size}/48222_2.png"568 }569 },570 "bookmarks": []571 },572 {573 "post_stream": {574 "posts": [575 {576 "id": 361316,577 "name": "Uzair Ahmed",578 "username": "uzair789",579 "avatar_template": "/letter_avatar_proxy/v4/letter/u/dc4da7/{size}.png",580 "created_at": "2022-08-11T19:44:49.465Z",581 "cooked": "<p>Hi,</p>\n<p>I am using the pruning tool box to prune a resnet18. I see that there is a function called prune.remove() which aims to make the pruning permanent. When should this function be called ideally?</p>\n<p>If i train a model, and then perform l1 structured pruning, make the pruning permanent by calling the prune.remove() and then finetune, the performance of the model is differnet from if i train the model, perform l1 structured pruning, fine tune and then make the pruning permanent right before deployment. I experimented with pruning_amount of 0.7, and the former method’s value is almost equal to the baseline unpruned model while the latter’s performance drops significantly which I think should be the case since we lost 70% of the filters in each layer.</p>\n<p>Can somebody please shed some light on this. I have my pruning code below</p>\n<pre><code class=\"lang-auto\"> prune_strategy = prune.ln_structured\n addn_params = {'n':1, 'dim':1}\n path_to_checkpoint = 'results/{}/checkpoint_200.pth'.format(checkpoint_folder)\n checkpoint = torch.load(path_to_checkpoint)\n #model.load_state_dict(checkpoint['model_state_dict'])\n model.load_state_dict(checkpoint)\n print(\"Model loaded successfully : \", path_to_checkpoint)\n num_params_before, num_params_after = 0, 0\n for name, module in model.named_modules():\n # print(name, module)\n # not pruning fc layers\n if isinstance(module, torch.nn.Conv2d):\n prune_strategy(module, name='weight', amount=args.prune_amount, **addn_params)\n prune.remove(module, name='weight')\n # if I run the prune.remove here while the layers are being pruned, the performace of the model \n # is as good as the baseline. If i comment it out, the performance drops.\n</code></pre>\n<p>Thank you,<br>\nUzair</p>",582 "post_number": 1,583 "post_type": 1,584 "posts_count": 2,585 "updated_at": "2022-08-11T19:44:49.465Z",586 "reply_count": 0,587 "reply_to_post_number": null,588 "quote_count": 0,589 "incoming_link_count": 426,590 "reads": 15,591 "readers_count": 14,592 "score": 2123.0,593 "yours": false,594 "topic_id": 158952,595 "topic_slug": "when-do-we-call-the-prune-remove-function-when-using-the-pruning-toolbox-to-prune-a-cnn",596 "display_username": "Uzair Ahmed",597 "primary_group_name": null,598 "flair_name": null,599 "flair_url": null,600 "flair_bg_color": null,601 "flair_color": null,602 "flair_group_id": null,603 "badges_granted": [],604 "version": 1,605 "can_edit": false,606 "can_delete": false,607 "can_recover": false,608 "can_see_hidden_post": false,609 "can_wiki": false,610 "read": true,611 "user_title": null,612 "bookmarked": false,613 "actions_summary": [],614 "moderator": false,615 "admin": false,616 "staff": false,617 "user_id": 58468,618 "hidden": false,619 "trust_level": 0,620 "deleted_at": null,621 "user_deleted": false,622 "edit_reason": null,623 "can_view_edit_history": true,624 "wiki": false,625 "post_url": "/t/when-do-we-call-the-prune-remove-function-when-using-the-pruning-toolbox-to-prune-a-cnn/158952/1",626 "can_accept_answer": false,627 "can_unaccept_answer": false,628 "accepted_answer": false,629 "topic_accepted_answer": null,630 "can_vote": false631 },632 {633 "id": 367478,634 "name": "Mubarek Mohammed",635 "username": "ube",636 "avatar_template": "/user_avatar/discuss.pytorch.org/ube/{size}/51984_2.png",637 "created_at": "2022-09-24T09:53:09.428Z",638 "cooked": "<p>Hi there,<br>\nI am working on pruning too. And I find this walkthrough helpful.<br>\ncheck it out <a href=\"https://www.youtube.com/watch?v=bQt0CLXXAqg&t=353s\" class=\"inline-onebox\" rel=\"noopener nofollow ugc\">The Lottery Ticket Hypothesis and pruning in PyTorch - YouTube</a></p>",639 "post_number": 2,640 "post_type": 1,641 "posts_count": 2,642 "updated_at": "2022-09-24T10:06:28.885Z",643 "reply_count": 0,644 "reply_to_post_number": null,645 "quote_count": 0,646 "incoming_link_count": 11,647 "reads": 9,648 "readers_count": 8,649 "score": 51.8,650 "yours": false,651 "topic_id": 158952,652 "topic_slug": "when-do-we-call-the-prune-remove-function-when-using-the-pruning-toolbox-to-prune-a-cnn",653 "display_username": "Mubarek Mohammed",654 "primary_group_name": null,655 "flair_name": null,656 "flair_url": null,657 "flair_bg_color": null,658 "flair_color": null,659 "flair_group_id": null,660 "badges_granted": [],661 "version": 2,662 "can_edit": false,663 "can_delete": false,664 "can_recover": false,665 "can_see_hidden_post": false,666 "can_wiki": false,667 "link_counts": [668 {669 "url": "https://www.youtube.com/watch?v=bQt0CLXXAqg&t=353s",670 "internal": false,671 "reflection": false,672 "title": "The Lottery Ticket Hypothesis and pruning in PyTorch - YouTube",673 "clicks": 73674 }675 ],676 "read": true,677 "user_title": null,678 "bookmarked": false,679 "actions_summary": [],680 "moderator": false,681 "admin": false,682 "staff": false,683 "user_id": 58186,684 "hidden": false,685 "trust_level": 1,686 "deleted_at": null,687 "user_deleted": false,688 "edit_reason": null,689 "can_view_edit_history": true,690 "wiki": false,691 "post_url": "/t/when-do-we-call-the-prune-remove-function-when-using-the-pruning-toolbox-to-prune-a-cnn/158952/2",692 "can_accept_answer": false,693 "can_unaccept_answer": false,694 "accepted_answer": false,695 "topic_accepted_answer": null696 }697 ],698 "stream": [699 361316,700 367478701 ]702 },703 "timeline_lookup": [704 [705 1,706 1171707 ],708 [709 2,710 1127711 ]712 ],713 "suggested_topics": [714 {715 "fancy_title": "Unexpected Behavior with Weight Sharing between nn.Linear and nn.Embedding",716 "id": 212223,717 "title": "Unexpected Behavior with Weight Sharing between nn.Linear and nn.Embedding",718 "slug": "unexpected-behavior-with-weight-sharing-between-nn-linear-and-nn-embedding",719 "posts_count": 3,720 "reply_count": 1,721 "highest_post_number": 3,722 "image_url": null,723 "created_at": "2024-10-28T22:58:14.282Z",724 "last_posted_at": "2024-10-29T00:47:09.870Z",725 "bumped": true,726 "bumped_at": "2024-10-29T00:47:09.870Z",727 "archetype": "regular",728 "unseen": false,729 "pinned": false,730 "unpinned": null,731 "visible": true,732 "closed": false,733 "archived": false,734 "bookmarked": null,735 "liked": null,736 "tags_descriptions": {},737 "like_count": 1,738 "views": 58,739 "category_id": 1,740 "featured_link": null,741 "has_accepted_answer": false,742 "posters": [743 {744 "extras": "latest",745 "description": "Original Poster, Most Recent Poster",746 "user": {747 "id": 59149,748 "username": "samlk",749 "name": "Kryštof Šaml",750 "avatar_template": "/letter_avatar_proxy/v4/letter/s/c57346/{size}.png",751 "trust_level": 1752 }753 },754 {755 "extras": null,756 "description": "Frequent Poster",757 "user": {758 "id": 3534,759 "username": "ptrblck",760 "name": "",761 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",762 "admin": true,763 "moderator": true,764 "trust_level": 2765 }766 }767 ]768 },769 {770 "fancy_title": "Jacobian matrix of right shape, but null everywhere",771 "id": 215947,772 "title": "Jacobian matrix of right shape, but null everywhere",773 "slug": "jacobian-matrix-of-right-shape-but-null-everywhere",774 "posts_count": 4,775 "reply_count": 2,776 "highest_post_number": 5,777 "image_url": null,778 "created_at": "2025-01-27T15:58:44.637Z",779 "last_posted_at": "2025-02-03T20:27:45.369Z",780 "bumped": true,781 "bumped_at": "2025-02-03T20:27:45.369Z",782 "archetype": "regular",783 "unseen": false,784 "pinned": false,785 "unpinned": null,786 "visible": true,787 "closed": false,788 "archived": false,789 "bookmarked": null,790 "liked": null,791 "tags_descriptions": {},792 "like_count": 1,793 "views": 76,794 "category_id": 1,795 "featured_link": null,796 "has_accepted_answer": false,797 "posters": [798 {799 "extras": null,800 "description": "Original Poster",801 "user": {802 "id": 82347,803 "username": "ErikVi",804 "name": "Erik",805 "avatar_template": "/user_avatar/discuss.pytorch.org/erikvi/{size}/75329_2.png",806 "trust_level": 0807 }808 },809 {810 "extras": "latest",811 "description": "Most Recent Poster",812 "user": {813 "id": 211,814 "username": "albanD",815 "name": "Alban D",816 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",817 "admin": true,818 "moderator": true,819 "trust_level": 4820 }821 }822 ]823 },824 {825 "fancy_title": "Call order of hooks",826 "id": 215863,827 "title": "Call order of hooks",828 "slug": "call-order-of-hooks",829 "posts_count": 1,830 "reply_count": 0,831 "highest_post_number": 1,832 "image_url": null,833 "created_at": "2025-01-25T16:57:33.402Z",834 "last_posted_at": "2025-01-25T16:57:33.447Z",835 "bumped": true,836 "bumped_at": "2025-01-25T16:57:33.447Z",837 "archetype": "regular",838 "unseen": false,839 "pinned": false,840 "unpinned": null,841 "visible": true,842 "closed": false,843 "archived": false,844 "bookmarked": null,845 "liked": null,846 "tags_descriptions": {},847 "like_count": 0,848 "views": 70,849 "category_id": 1,850 "featured_link": null,851 "has_accepted_answer": false,852 "posters": [853 {854 "extras": "latest single",855 "description": "Original Poster, Most Recent Poster",856 "user": {857 "id": 82245,858 "username": "sternj",859 "name": null,860 "avatar_template": "/letter_avatar_proxy/v4/letter/s/b19c9b/{size}.png",861 "trust_level": 1862 }863 }864 ]865 },866 {867 "fancy_title": "Low GPU Utilization without obvious bottlnecks",868 "id": 215868,869 "title": "Low GPU Utilization without obvious bottlnecks",870 "slug": "low-gpu-utilization-without-obvious-bottlnecks",871 "posts_count": 1,872 "reply_count": 0,873 "highest_post_number": 1,874 "image_url": null,875 "created_at": "2025-01-25T18:26:13.003Z",876 "last_posted_at": "2025-01-25T18:26:13.040Z",877 "bumped": true,878 "bumped_at": "2025-01-25T18:26:13.040Z",879 "archetype": "regular",880 "unseen": false,881 "pinned": false,882 "unpinned": null,883 "visible": true,884 "closed": false,885 "archived": false,886 "bookmarked": null,887 "liked": null,888 "tags_descriptions": {},889 "like_count": 0,890 "views": 115,891 "category_id": 1,892 "featured_link": null,893 "has_accepted_answer": false,894 "posters": [895 {896 "extras": "latest single",897 "description": "Original Poster, Most Recent Poster",898 "user": {899 "id": 82312,900 "username": "Rezzy139",901 "name": "",902 "avatar_template": "/letter_avatar_proxy/v4/letter/r/7bcc69/{size}.png",903 "trust_level": 1904 }905 }906 ]907 },908 {909 "fancy_title": "CUDA stream sync issue in custom activation offloader",910 "id": 219131,911 "title": "CUDA stream sync issue in custom activation offloader",912 "slug": "cuda-stream-sync-issue-in-custom-activation-offloader",913 "posts_count": 1,914 "reply_count": 0,915 "highest_post_number": 1,916 "image_url": null,917 "created_at": "2025-04-16T02:51:08.428Z",918 "last_posted_at": "2025-04-16T02:51:08.474Z",919 "bumped": true,920 "bumped_at": "2025-04-16T17:48:36.597Z",921 "archetype": "regular",922 "unseen": false,923 "pinned": false,924 "unpinned": null,925 "visible": true,926 "closed": false,927 "archived": false,928 "bookmarked": null,929 "liked": null,930 "tags_descriptions": {},931 "like_count": 0,932 "views": 51,933 "category_id": 1,934 "featured_link": null,935 "has_accepted_answer": false,936 "posters": [937 {938 "extras": "latest single",939 "description": "Original Poster, Most Recent Poster",940 "user": {941 "id": 82981,942 "username": "Vatsal_Joshi",943 "name": "Vatsal Joshi",944 "avatar_template": "/user_avatar/discuss.pytorch.org/vatsal_joshi/{size}/75911_2.png",945 "trust_level": 1946 }947 }948 ]949 }950 ],951 "tags_descriptions": {},952 "fancy_title": "When do we call the prune.remove() function when using the pruning toolbox to prune a cnn?",953 "id": 158952,954 "title": "When do we call the prune.remove() function when using the pruning toolbox to prune a cnn?",955 "posts_count": 2,956 "created_at": "2022-08-11T19:44:49.394Z",957 "views": 710,958 "reply_count": 0,959 "like_count": 0,960 "last_posted_at": "2022-09-24T09:53:09.428Z",961 "visible": true,962 "closed": false,963 "archived": false,964 "has_summary": false,965 "archetype": "regular",966 "slug": "when-do-we-call-the-prune-remove-function-when-using-the-pruning-toolbox-to-prune-a-cnn",967 "category_id": 1,968 "word_count": 273,969 "deleted_at": null,970 "user_id": 58468,971 "featured_link": null,972 "pinned_globally": false,973 "pinned_at": null,974 "pinned_until": null,975 "image_url": null,976 "slow_mode_seconds": 0,977 "draft": null,978 "draft_key": "topic_158952",979 "draft_sequence": null,980 "unpinned": null,981 "pinned": false,982 "current_post_number": 1,983 "highest_post_number": 2,984 "deleted_by": null,985 "actions_summary": [986 {987 "id": 4,988 "count": 0,989 "hidden": false,990 "can_act": false991 },992 {993 "id": 8,994 "count": 0,995 "hidden": false,996 "can_act": false997 },998 {999 "id": 10,1000 "count": 0,1001 "hidden": false,1002 "can_act": false1003 },1004 {1005 "id": 7,1006 "count": 0,1007 "hidden": false,1008 "can_act": false1009 }1010 ],1011 "chunk_size": 20,1012 "bookmarked": false,1013 "topic_timer": null,1014 "message_bus_last_id": 0,1015 "participant_count": 2,1016 "show_read_indicator": false,1017 "thumbnails": null,1018 "slow_mode_enabled_until": null,1019 "can_vote": false,1020 "vote_count": 0,1021 "user_voted": false,1022 "discourse_zendesk_plugin_zendesk_id": null,1023 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1024 "details": {1025 "can_edit": false,1026 "notification_level": 1,1027 "participants": [1028 {1029 "id": 58186,1030 "username": "ube",1031 "name": "Mubarek Mohammed",1032 "avatar_template": "/user_avatar/discuss.pytorch.org/ube/{size}/51984_2.png",1033 "post_count": 1,1034 "primary_group_name": null,1035 "flair_name": null,1036 "flair_url": null,1037 "flair_color": null,1038 "flair_bg_color": null,1039 "flair_group_id": null,1040 "trust_level": 11041 },1042 {1043 "id": 58468,1044 "username": "uzair789",1045 "name": "Uzair Ahmed",1046 "avatar_template": "/letter_avatar_proxy/v4/letter/u/dc4da7/{size}.png",1047 "post_count": 1,1048 "primary_group_name": null,1049 "flair_name": null,1050 "flair_url": null,1051 "flair_color": null,1052 "flair_bg_color": null,1053 "flair_group_id": null,1054 "trust_level": 01055 }1056 ],1057 "created_by": {1058 "id": 58468,1059 "username": "uzair789",1060 "name": "Uzair Ahmed",1061 "avatar_template": "/letter_avatar_proxy/v4/letter/u/dc4da7/{size}.png"1062 },1063 "last_poster": {1064 "id": 58186,1065 "username": "ube",1066 "name": "Mubarek Mohammed",1067 "avatar_template": "/user_avatar/discuss.pytorch.org/ube/{size}/51984_2.png"1068 },1069 "links": [1070 {1071 "url": "https://www.youtube.com/watch?v=bQt0CLXXAqg&t=353s",1072 "title": "The Lottery Ticket Hypothesis and pruning in PyTorch - YouTube",1073 "internal": false,1074 "attachment": false,1075 "reflection": false,1076 "clicks": 73,1077 "user_id": 58186,1078 "domain": "www.youtube.com",1079 "root_domain": "youtube.com"1080 }1081 ]1082 },1083 "bookmarks": []1084 },1085 {1086 "post_stream": {1087 "posts": [1088 {1089 "id": 367225,1090 "name": "",1091 "username": "razla",1092 "avatar_template": "/user_avatar/discuss.pytorch.org/razla/{size}/41396_2.png",1093 "created_at": "2022-09-22T11:17:02.187Z",1094 "cooked": "<p>Hey,</p>\n<p>I want to replace all ReLU(inplace=True) with ReLU(inplace=False) - but I want it to be generic for all pretrained models - vgg16, resnet, etc.</p>\n<p>Is it possible? since each model has different architecture and thus different hierarchy.</p>\n<p>Thank you!</p>",1095 "post_number": 1,1096 "post_type": 1,1097 "posts_count": 3,1098 "updated_at": "2022-09-22T11:17:02.187Z",1099 "reply_count": 0,1100 "reply_to_post_number": null,1101 "quote_count": 0,1102 "incoming_link_count": 172,1103 "reads": 11,1104 "readers_count": 10,1105 "score": 862.2,1106 "yours": false,1107 "topic_id": 161969,1108 "topic_slug": "replacing-all-relu-inplace-true-with-relu-inplace-false-for-all-pretrained-models",1109 "display_username": "",1110 "primary_group_name": null,1111 "flair_name": null,1112 "flair_url": null,1113 "flair_bg_color": null,1114 "flair_color": null,1115 "flair_group_id": null,1116 "badges_granted": [],1117 "version": 1,1118 "can_edit": false,1119 "can_delete": false,1120 "can_recover": false,1121 "can_see_hidden_post": false,1122 "can_wiki": false,1123 "read": true,1124 "user_title": null,1125 "bookmarked": false,1126 "actions_summary": [],1127 "moderator": false,1128 "admin": false,1129 "staff": false,1130 "user_id": 48241,1131 "hidden": false,1132 "trust_level": 1,1133 "deleted_at": null,1134 "user_deleted": false,1135 "edit_reason": null,1136 "can_view_edit_history": true,1137 "wiki": false,1138 "post_url": "/t/replacing-all-relu-inplace-true-with-relu-inplace-false-for-all-pretrained-models/161969/1",1139 "can_accept_answer": false,1140 "can_unaccept_answer": false,1141 "accepted_answer": false,1142 "topic_accepted_answer": null,1143 "can_vote": false1144 },1145 {1146 "id": 367284,1147 "name": "",1148 "username": "ptrblck",1149 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1150 "created_at": "2022-09-22T18:05:04.304Z",1151 "cooked": "<p>I think you should be able to use <code>torch.fx</code> with its ability to manipulate the graph as described <a href=\"https://pytorch.org/docs/stable/fx.html#direct-graph-manipulation\">here</a>. In the example they are replacing <code>add()</code> with <code>mul()</code> calls and I assume you can use the same or similar approach to replace the <code>ReLU</code> modules.</p>",1152 "post_number": 2,1153 "post_type": 1,1154 "posts_count": 3,1155 "updated_at": "2022-09-22T18:05:04.304Z",1156 "reply_count": 1,1157 "reply_to_post_number": null,1158 "quote_count": 0,1159 "incoming_link_count": 2,1160 "reads": 11,1161 "readers_count": 10,1162 "score": 17.2,1163 "yours": false,1164 "topic_id": 161969,1165 "topic_slug": "replacing-all-relu-inplace-true-with-relu-inplace-false-for-all-pretrained-models",1166 "display_username": "",1167 "primary_group_name": null,1168 "flair_name": null,1169 "flair_url": null,1170 "flair_bg_color": null,1171 "flair_color": null,1172 "flair_group_id": null,1173 "badges_granted": [],1174 "version": 1,1175 "can_edit": false,1176 "can_delete": false,1177 "can_recover": false,1178 "can_see_hidden_post": false,1179 "can_wiki": false,1180 "link_counts": [1181 {1182 "url": "https://pytorch.org/docs/stable/fx.html#direct-graph-manipulation",1183 "internal": false,1184 "reflection": false,1185 "title": "torch.fx — PyTorch 1.12 documentation",1186 "clicks": 241187 }1188 ],1189 "read": true,1190 "user_title": "",1191 "bookmarked": false,1192 "actions_summary": [],1193 "moderator": true,1194 "admin": true,1195 "staff": true,1196 "user_id": 3534,1197 "hidden": false,1198 "trust_level": 2,1199 "deleted_at": null,1200 "user_deleted": false,