Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 350686,7 "name": "Iskandar Zulkarnaen",8 "username": "Iskandar_Zulkarnaen",9 "avatar_template": "/user_avatar/discuss.pytorch.org/iskandar_zulkarnaen/{size}/50271_2.png",10 "created_at": "2022-06-08T19:48:36.356Z",11 "cooked": "<p>Hello i’m newbie in pytorch and vision.<br>\nI have a code like this.</p>\n<pre><code class=\"lang-auto\">from engine import train_one_epoch\n# Training\nwriter = SummaryWriter()\nstart = datetime.now()\nfor epoch in range(epochs):\n # train for one epoch, printing every 50 iterations\n train_one_epoch(model, optimizer, loader_train, device, epoch, print_freq=20)\n # update the learning rate\n lr_scheduler.step()\n # evaluate on the test dataset\n evaluate(model, loader_val, device=device)\nend = datetime.now()\n</code></pre>\n<p>Anyone can tell me how to add a tensorboard to monitor my training. Thanks</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 2,15 "updated_at": "2022-06-08T19:48:36.356Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 56,20 "reads": 3,21 "readers_count": 2,22 "score": 280.6,23 "yours": false,24 "topic_id": 153706,25 "topic_slug": "how-to-connect-vision-with-tensorboard",26 "display_username": "Iskandar Zulkarnaen",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": 56524,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/how-to-connect-vision-with-tensorboard/153706/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": 350743,64 "name": "",65 "username": "ptrblck",66 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",67 "created_at": "2022-06-09T05:29:09.360Z",68 "cooked": "<p><a href=\"https://pytorch.org/tutorials/recipes/recipes/tensorboard_with_pytorch.html\">This tutorial</a> might be helpful.</p>",69 "post_number": 2,70 "post_type": 1,71 "posts_count": 2,72 "updated_at": "2022-06-09T05:29:09.360Z",73 "reply_count": 0,74 "reply_to_post_number": null,75 "quote_count": 0,76 "incoming_link_count": 2,77 "reads": 2,78 "readers_count": 1,79 "score": 10.4,80 "yours": false,81 "topic_id": 153706,82 "topic_slug": "how-to-connect-vision-with-tensorboard",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 "link_counts": [98 {99 "url": "https://pytorch.org/tutorials/recipes/recipes/tensorboard_with_pytorch.html",100 "internal": false,101 "reflection": false,102 "title": "How to use TensorBoard with PyTorch — PyTorch Tutorials 1.11.0+cu102 documentation",103 "clicks": 22104 }105 ],106 "read": true,107 "user_title": "",108 "bookmarked": false,109 "actions_summary": [],110 "moderator": true,111 "admin": true,112 "staff": true,113 "user_id": 3534,114 "hidden": false,115 "trust_level": 2,116 "deleted_at": null,117 "user_deleted": false,118 "edit_reason": null,119 "can_view_edit_history": true,120 "wiki": false,121 "post_url": "/t/how-to-connect-vision-with-tensorboard/153706/2",122 "can_accept_answer": false,123 "can_unaccept_answer": false,124 "accepted_answer": false,125 "topic_accepted_answer": null126 }127 ],128 "stream": [129 350686,130 350743131 ]132 },133 "timeline_lookup": [134 [135 1,136 1235137 ]138 ],139 "suggested_topics": [140 {141 "fancy_title": "Custom Dataset __getitem__ is receiving a list from DataLoader",142 "id": 217592,143 "title": "Custom Dataset __getitem__ is receiving a list from DataLoader",144 "slug": "custom-dataset-getitem-is-receiving-a-list-from-dataloader",145 "posts_count": 4,146 "reply_count": 2,147 "highest_post_number": 4,148 "image_url": null,149 "created_at": "2025-03-08T12:27:38.663Z",150 "last_posted_at": "2025-03-14T05:32:05.342Z",151 "bumped": true,152 "bumped_at": "2025-03-14T05:32:05.342Z",153 "archetype": "regular",154 "unseen": false,155 "pinned": false,156 "unpinned": null,157 "visible": true,158 "closed": false,159 "archived": false,160 "bookmarked": null,161 "liked": null,162 "tags_descriptions": {},163 "like_count": 0,164 "views": 77,165 "category_id": 5,166 "featured_link": null,167 "has_accepted_answer": false,168 "posters": [169 {170 "extras": null,171 "description": "Original Poster",172 "user": {173 "id": 83139,174 "username": "Gabrichilleron",175 "name": "Gabriel Chilleron peinado",176 "avatar_template": "/user_avatar/discuss.pytorch.org/gabrichilleron/{size}/76040_2.png",177 "trust_level": 0178 }179 },180 {181 "extras": null,182 "description": "Frequent Poster",183 "user": {184 "id": 69167,185 "username": "lostalot",186 "name": "",187 "avatar_template": "/letter_avatar_proxy/v4/letter/l/858c86/{size}.png",188 "trust_level": 1189 }190 },191 {192 "extras": "latest",193 "description": "Most Recent Poster",194 "user": {195 "id": 74591,196 "username": "UMAR_MASUD",197 "name": "UMAR MASUD",198 "avatar_template": "/user_avatar/discuss.pytorch.org/umar_masud/{size}/68863_2.png",199 "trust_level": 2200 }201 }202 ]203 },204 {205 "fancy_title": "Does order of transforms applied for data augmentation matter in Torchvision transforms?",206 "id": 215592,207 "title": "Does order of transforms applied for data augmentation matter in Torchvision transforms?",208 "slug": "does-order-of-transforms-applied-for-data-augmentation-matter-in-torchvision-transforms",209 "posts_count": 2,210 "reply_count": 0,211 "highest_post_number": 2,212 "image_url": null,213 "created_at": "2025-01-19T14:06:57.627Z",214 "last_posted_at": "2025-01-24T11:03:36.088Z",215 "bumped": true,216 "bumped_at": "2025-01-24T11:03:36.088Z",217 "archetype": "regular",218 "unseen": false,219 "pinned": false,220 "unpinned": null,221 "visible": true,222 "closed": false,223 "archived": false,224 "bookmarked": null,225 "liked": null,226 "tags_descriptions": {},227 "like_count": 0,228 "views": 73,229 "category_id": 5,230 "featured_link": null,231 "has_accepted_answer": false,232 "posters": [233 {234 "extras": null,235 "description": "Original Poster",236 "user": {237 "id": 82180,238 "username": "Amit_Sur",239 "name": "Amit Sur",240 "avatar_template": "/user_avatar/discuss.pytorch.org/amit_sur/{size}/75195_2.png",241 "trust_level": 1242 }243 },244 {245 "extras": "latest",246 "description": "Most Recent Poster",247 "user": {248 "id": 32812,249 "username": "Bjorn_Lindqvist",250 "name": "Björn Lindqvist",251 "avatar_template": "/user_avatar/discuss.pytorch.org/bjorn_lindqvist/{size}/25326_2.png",252 "trust_level": 2253 }254 }255 ]256 },257 {258 "fancy_title": "Looking for realiable pytorch code base finetune stable diffusion",259 "id": 216254,260 "title": "Looking for realiable pytorch code base finetune stable diffusion",261 "slug": "looking-for-realiable-pytorch-code-base-finetune-stable-diffusion",262 "posts_count": 1,263 "reply_count": 0,264 "highest_post_number": 1,265 "image_url": null,266 "created_at": "2025-02-05T07:11:21.881Z",267 "last_posted_at": "2025-02-05T07:11:21.968Z",268 "bumped": true,269 "bumped_at": "2025-02-05T07:11:21.968Z",270 "archetype": "regular",271 "unseen": false,272 "pinned": false,273 "unpinned": null,274 "visible": true,275 "closed": false,276 "archived": false,277 "bookmarked": null,278 "liked": null,279 "tags_descriptions": {},280 "like_count": 0,281 "views": 21,282 "category_id": 5,283 "featured_link": null,284 "has_accepted_answer": false,285 "posters": [286 {287 "extras": "latest single",288 "description": "Original Poster, Most Recent Poster",289 "user": {290 "id": 60459,291 "username": "hiru",292 "name": "Hiru",293 "avatar_template": "/letter_avatar_proxy/v4/letter/h/d2c977/{size}.png",294 "trust_level": 1295 }296 }297 ]298 },299 {300 "fancy_title": "What is the correct way to implement a transformer based vision classifier with nn.TransformerEncoder?",301 "id": 217414,302 "title": "What is the correct way to implement a transformer based vision classifier with nn.TransformerEncoder?",303 "slug": "what-is-the-correct-way-to-implement-a-transformer-based-vision-classifier-with-nn-transformerencoder",304 "posts_count": 1,305 "reply_count": 0,306 "highest_post_number": 1,307 "image_url": null,308 "created_at": "2025-03-04T03:49:19.978Z",309 "last_posted_at": "2025-03-04T03:49:20.017Z",310 "bumped": true,311 "bumped_at": "2025-03-04T03:49:20.017Z",312 "archetype": "regular",313 "unseen": false,314 "pinned": false,315 "unpinned": null,316 "visible": true,317 "closed": false,318 "archived": false,319 "bookmarked": null,320 "liked": null,321 "tags_descriptions": {},322 "like_count": 0,323 "views": 25,324 "category_id": 5,325 "featured_link": null,326 "has_accepted_answer": false,327 "posters": [328 {329 "extras": "latest single",330 "description": "Original Poster, Most Recent Poster",331 "user": {332 "id": 45116,333 "username": "JimW",334 "name": "",335 "avatar_template": "/user_avatar/discuss.pytorch.org/jimw/{size}/38000_2.png",336 "trust_level": 1337 }338 }339 ]340 },341 {342 "fancy_title": "I want to collbrate with you",343 "id": 219369,344 "title": "I want to collbrate with you",345 "slug": "i-want-to-collbrate-with-you",346 "posts_count": 3,347 "reply_count": 0,348 "highest_post_number": 3,349 "image_url": null,350 "created_at": "2025-04-23T09:53:53.905Z",351 "last_posted_at": "2025-04-23T17:20:29.347Z",352 "bumped": true,353 "bumped_at": "2025-04-23T17:20:29.347Z",354 "archetype": "regular",355 "unseen": false,356 "pinned": false,357 "unpinned": null,358 "visible": true,359 "closed": false,360 "archived": false,361 "bookmarked": null,362 "liked": null,363 "tags_descriptions": {},364 "like_count": 0,365 "views": 62,366 "category_id": 5,367 "featured_link": null,368 "has_accepted_answer": false,369 "posters": [370 {371 "extras": null,372 "description": "Original Poster",373 "user": {374 "id": 83961,375 "username": "Ujjwal_Yadav",376 "name": "Ujjwal Yadav",377 "avatar_template": "/user_avatar/discuss.pytorch.org/ujjwal_yadav/{size}/76750_2.png",378 "trust_level": 0379 }380 },381 {382 "extras": null,383 "description": "Frequent Poster",384 "user": {385 "id": 3534,386 "username": "ptrblck",387 "name": "",388 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",389 "admin": true,390 "moderator": true,391 "trust_level": 2392 }393 },394 {395 "extras": "latest",396 "description": "Most Recent Poster",397 "user": {398 "id": 75469,399 "username": "Matt_White",400 "name": "Matt White",401 "avatar_template": "/user_avatar/discuss.pytorch.org/matt_white/{size}/69693_2.png",402 "admin": true,403 "trust_level": 1404 }405 }406 ]407 }408 ],409 "tags_descriptions": {},410 "fancy_title": "How to connect vision with tensorboard",411 "id": 153706,412 "title": "How to connect vision with tensorboard",413 "posts_count": 2,414 "created_at": "2022-06-08T19:48:36.257Z",415 "views": 403,416 "reply_count": 0,417 "like_count": 0,418 "last_posted_at": "2022-06-09T05:29:09.360Z",419 "visible": true,420 "closed": false,421 "archived": false,422 "has_summary": false,423 "archetype": "regular",424 "slug": "how-to-connect-vision-with-tensorboard",425 "category_id": 5,426 "word_count": 91,427 "deleted_at": null,428 "user_id": 56524,429 "featured_link": null,430 "pinned_globally": false,431 "pinned_at": null,432 "pinned_until": null,433 "image_url": null,434 "slow_mode_seconds": 0,435 "draft": null,436 "draft_key": "topic_153706",437 "draft_sequence": null,438 "unpinned": null,439 "pinned": false,440 "current_post_number": 1,441 "highest_post_number": 2,442 "deleted_by": null,443 "actions_summary": [444 {445 "id": 4,446 "count": 0,447 "hidden": false,448 "can_act": false449 },450 {451 "id": 8,452 "count": 0,453 "hidden": false,454 "can_act": false455 },456 {457 "id": 10,458 "count": 0,459 "hidden": false,460 "can_act": false461 },462 {463 "id": 7,464 "count": 0,465 "hidden": false,466 "can_act": false467 }468 ],469 "chunk_size": 20,470 "bookmarked": false,471 "topic_timer": null,472 "message_bus_last_id": 0,473 "participant_count": 2,474 "show_read_indicator": false,475 "thumbnails": null,476 "slow_mode_enabled_until": null,477 "can_vote": false,478 "vote_count": 0,479 "user_voted": false,480 "discourse_zendesk_plugin_zendesk_id": null,481 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",482 "details": {483 "can_edit": false,484 "notification_level": 1,485 "participants": [486 {487 "id": 3534,488 "username": "ptrblck",489 "name": "",490 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",491 "post_count": 1,492 "primary_group_name": null,493 "flair_name": null,494 "flair_url": null,495 "flair_color": null,496 "flair_bg_color": null,497 "flair_group_id": null,498 "admin": true,499 "moderator": true,500 "trust_level": 2501 },502 {503 "id": 56524,504 "username": "Iskandar_Zulkarnaen",505 "name": "Iskandar Zulkarnaen",506 "avatar_template": "/user_avatar/discuss.pytorch.org/iskandar_zulkarnaen/{size}/50271_2.png",507 "post_count": 1,508 "primary_group_name": null,509 "flair_name": null,510 "flair_url": null,511 "flair_color": null,512 "flair_bg_color": null,513 "flair_group_id": null,514 "trust_level": 0515 }516 ],517 "created_by": {518 "id": 56524,519 "username": "Iskandar_Zulkarnaen",520 "name": "Iskandar Zulkarnaen",521 "avatar_template": "/user_avatar/discuss.pytorch.org/iskandar_zulkarnaen/{size}/50271_2.png"522 },523 "last_poster": {524 "id": 3534,525 "username": "ptrblck",526 "name": "",527 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"528 },529 "links": [530 {531 "url": "https://pytorch.org/tutorials/recipes/recipes/tensorboard_with_pytorch.html",532 "title": "How to use TensorBoard with PyTorch — PyTorch Tutorials 1.11.0+cu102 documentation",533 "internal": false,534 "attachment": false,535 "reflection": false,536 "clicks": 22,537 "user_id": 3534,538 "domain": "pytorch.org",539 "root_domain": "pytorch.org"540 }541 ]542 },543 "bookmarks": []544 },545 {546 "post_stream": {547 "posts": [548 {549 "id": 350568,550 "name": "Sumesh Sankar",551 "username": "Sumesh_Sankar",552 "avatar_template": "/user_avatar/discuss.pytorch.org/sumesh_sankar/{size}/45448_2.png",553 "created_at": "2022-06-08T09:58:39.808Z",554 "cooked": "<p>given a tensorflow model how do i convert it into pytorch</p>",555 "post_number": 1,556 "post_type": 1,557 "posts_count": 2,558 "updated_at": "2022-06-08T09:58:39.808Z",559 "reply_count": 0,560 "reply_to_post_number": null,561 "quote_count": 0,562 "incoming_link_count": 6,563 "reads": 2,564 "readers_count": 1,565 "score": 30.4,566 "yours": false,567 "topic_id": 153648,568 "topic_slug": "given-a-tensorflow-model-how-do-i-convert-it-into-pytorch",569 "display_username": "Sumesh Sankar",570 "primary_group_name": null,571 "flair_name": null,572 "flair_url": null,573 "flair_bg_color": null,574 "flair_color": null,575 "flair_group_id": null,576 "badges_granted": [],577 "version": 1,578 "can_edit": false,579 "can_delete": false,580 "can_recover": false,581 "can_see_hidden_post": false,582 "can_wiki": false,583 "read": true,584 "user_title": null,585 "bookmarked": false,586 "actions_summary": [],587 "moderator": false,588 "admin": false,589 "staff": false,590 "user_id": 56614,591 "hidden": false,592 "trust_level": 1,593 "deleted_at": null,594 "user_deleted": false,595 "edit_reason": null,596 "can_view_edit_history": true,597 "wiki": false,598 "post_url": "/t/given-a-tensorflow-model-how-do-i-convert-it-into-pytorch/153648/1",599 "can_accept_answer": false,600 "can_unaccept_answer": false,601 "accepted_answer": false,602 "topic_accepted_answer": null,603 "can_vote": false604 },605 {606 "id": 350738,607 "name": "",608 "username": "ptrblck",609 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",610 "created_at": "2022-06-09T05:16:53.730Z",611 "cooked": "<p>You could rewrite the model by porting each layer and verifying its functionality e.g. by making sure the random initialization of each parameter and buffer is equal.<br>\nThe layer names should be quite similar for the majority of layers. I don’t know if there are any useful tools to automate this process.</p>",612 "post_number": 2,613 "post_type": 1,614 "posts_count": 2,615 "updated_at": "2022-06-09T05:16:53.730Z",616 "reply_count": 0,617 "reply_to_post_number": null,618 "quote_count": 0,619 "incoming_link_count": 2,620 "reads": 2,621 "readers_count": 1,622 "score": 10.4,623 "yours": false,624 "topic_id": 153648,625 "topic_slug": "given-a-tensorflow-model-how-do-i-convert-it-into-pytorch",626 "display_username": "",627 "primary_group_name": null,628 "flair_name": null,629 "flair_url": null,630 "flair_bg_color": null,631 "flair_color": null,632 "flair_group_id": null,633 "badges_granted": [],634 "version": 1,635 "can_edit": false,636 "can_delete": false,637 "can_recover": false,638 "can_see_hidden_post": false,639 "can_wiki": false,640 "read": true,641 "user_title": "",642 "bookmarked": false,643 "actions_summary": [],644 "moderator": true,645 "admin": true,646 "staff": true,647 "user_id": 3534,648 "hidden": false,649 "trust_level": 2,650 "deleted_at": null,651 "user_deleted": false,652 "edit_reason": null,653 "can_view_edit_history": true,654 "wiki": false,655 "post_url": "/t/given-a-tensorflow-model-how-do-i-convert-it-into-pytorch/153648/2",656 "can_accept_answer": false,657 "can_unaccept_answer": false,658 "accepted_answer": false,659 "topic_accepted_answer": null660 }661 ],662 "stream": [663 350568,664 350738665 ]666 },667 "timeline_lookup": [668 [669 1,670 1235671 ]672 ],673 "suggested_topics": [674 {675 "fancy_title": "Reproducibility on different platform",676 "id": 222071,677 "title": "Reproducibility on different platform",678 "slug": "reproducibility-on-different-platform",679 "posts_count": 2,680 "reply_count": 0,681 "highest_post_number": 2,682 "image_url": null,683 "created_at": "2025-08-05T08:49:45.089Z",684 "last_posted_at": "2025-08-05T14:13:47.230Z",685 "bumped": true,686 "bumped_at": "2025-08-05T14:13:47.230Z",687 "archetype": "regular",688 "unseen": false,689 "pinned": false,690 "unpinned": null,691 "visible": true,692 "closed": false,693 "archived": false,694 "bookmarked": null,695 "liked": null,696 "tags_descriptions": {},697 "like_count": 1,698 "views": 29,699 "category_id": 1,700 "featured_link": null,701 "has_accepted_answer": true,702 "posters": [703 {704 "extras": null,705 "description": "Original Poster",706 "user": {707 "id": 80612,708 "username": "songh11",709 "name": "Songh11",710 "avatar_template": "/user_avatar/discuss.pytorch.org/songh11/{size}/73698_2.png",711 "trust_level": 1712 }713 },714 {715 "extras": "latest",716 "description": "Most Recent Poster, Accepted Answer",717 "user": {718 "id": 3534,719 "username": "ptrblck",720 "name": "",721 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",722 "admin": true,723 "moderator": true,724 "trust_level": 2725 }726 }727 ]728 },729 {730 "fancy_title": "Forward and Backward hook",731 "id": 213875,732 "title": "Forward and Backward hook",733 "slug": "forward-and-backward-hook",734 "posts_count": 2,735 "reply_count": 0,736 "highest_post_number": 2,737 "image_url": null,738 "created_at": "2024-12-05T20:27:43.873Z",739 "last_posted_at": "2024-12-06T22:11:47.885Z",740 "bumped": true,741 "bumped_at": "2024-12-06T22:11:47.885Z",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": 2,753 "views": 85,754 "category_id": 1,755 "featured_link": null,756 "has_accepted_answer": false,757 "posters": [758 {759 "extras": null,760 "description": "Original Poster",761 "user": {762 "id": 67856,763 "username": "ShnekaM",764 "name": "Shneka Muthu Kumara Swamy",765 "avatar_template": "/letter_avatar_proxy/v4/letter/s/c57346/{size}.png",766 "trust_level": 1767 }768 },769 {770 "extras": "latest",771 "description": "Most Recent 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 },784 {785 "fancy_title": "Unexpected Behavior with Weight Sharing between nn.Linear and nn.Embedding",786 "id": 212223,787 "title": "Unexpected Behavior with Weight Sharing between nn.Linear and nn.Embedding",788 "slug": "unexpected-behavior-with-weight-sharing-between-nn-linear-and-nn-embedding",789 "posts_count": 3,790 "reply_count": 1,791 "highest_post_number": 3,792 "image_url": null,793 "created_at": "2024-10-28T22:58:14.282Z",794 "last_posted_at": "2024-10-29T00:47:09.870Z",795 "bumped": true,796 "bumped_at": "2024-10-29T00:47:09.870Z",797 "archetype": "regular",798 "unseen": false,799 "pinned": false,800 "unpinned": null,801 "visible": true,802 "closed": false,803 "archived": false,804 "bookmarked": null,805 "liked": null,806 "tags_descriptions": {},807 "like_count": 1,808 "views": 58,809 "category_id": 1,810 "featured_link": null,811 "has_accepted_answer": false,812 "posters": [813 {814 "extras": "latest",815 "description": "Original Poster, Most Recent Poster",816 "user": {817 "id": 59149,818 "username": "samlk",819 "name": "Kryštof Šaml",820 "avatar_template": "/letter_avatar_proxy/v4/letter/s/c57346/{size}.png",821 "trust_level": 1822 }823 },824 {825 "extras": null,826 "description": "Frequent Poster",827 "user": {828 "id": 3534,829 "username": "ptrblck",830 "name": "",831 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",832 "admin": true,833 "moderator": true,834 "trust_level": 2835 }836 }837 ]838 },839 {840 "fancy_title": "Question about utilizing vmap to calculate per-sample gradient",841 "id": 221531,842 "title": "Question about utilizing vmap to calculate per-sample gradient",843 "slug": "question-about-utilizing-vmap-to-calculate-per-sample-gradient",844 "posts_count": 1,845 "reply_count": 0,846 "highest_post_number": 1,847 "image_url": null,848 "created_at": "2025-07-15T07:19:58.270Z",849 "last_posted_at": "2025-07-15T07:19:58.369Z",850 "bumped": true,851 "bumped_at": "2025-07-15T07:19:58.369Z",852 "archetype": "regular",853 "unseen": false,854 "pinned": false,855 "unpinned": null,856 "visible": true,857 "closed": false,858 "archived": false,859 "bookmarked": null,860 "liked": null,861 "tags_descriptions": {},862 "like_count": 0,863 "views": 17,864 "category_id": 1,865 "featured_link": null,866 "has_accepted_answer": false,867 "posters": [868 {869 "extras": "latest single",870 "description": "Original Poster, Most Recent Poster",871 "user": {872 "id": 85085,873 "username": "ymhwang",874 "name": "",875 "avatar_template": "/letter_avatar_proxy/v4/letter/y/ed655f/{size}.png",876 "trust_level": 0877 }878 }879 ]880 },881 {882 "fancy_title": "DDP implementation with overlapping communication and computation with backward hook",883 "id": 222488,884 "title": "DDP implementation with overlapping communication and computation with backward hook",885 "slug": "ddp-implementation-with-overlapping-communication-and-computation-with-backward-hook",886 "posts_count": 2,887 "reply_count": 0,888 "highest_post_number": 2,889 "image_url": null,890 "created_at": "2025-08-19T17:42:47.997Z",891 "last_posted_at": "2025-08-23T03:59:19.003Z",892 "bumped": true,893 "bumped_at": "2025-08-23T03:59:19.003Z",894 "archetype": "regular",895 "unseen": false,896 "pinned": false,897 "unpinned": null,898 "visible": true,899 "closed": false,900 "archived": false,901 "bookmarked": null,902 "liked": null,903 "tags_descriptions": {},904 "like_count": 0,905 "views": 21,906 "category_id": 1,907 "featured_link": null,908 "has_accepted_answer": true,909 "posters": [910 {911 "extras": "latest single",912 "description": "Original Poster, Most Recent Poster, Accepted Answer",913 "user": {914 "id": 53434,915 "username": "Robin_Ranabhat",916 "name": "Robin Narsingh Ranabhat",917 "avatar_template": "/user_avatar/discuss.pytorch.org/robin_ranabhat/{size}/46884_2.png",918 "trust_level": 1919 }920 }921 ]922 }923 ],924 "tags_descriptions": {},925 "fancy_title": "Given a tensorflow model how do i convert it into pytorch",926 "id": 153648,927 "title": "Given a tensorflow model how do i convert it into pytorch",928 "posts_count": 2,929 "created_at": "2022-06-08T09:58:39.717Z",930 "views": 378,931 "reply_count": 0,932 "like_count": 0,933 "last_posted_at": "2022-06-09T05:16:53.730Z",934 "visible": true,935 "closed": false,936 "archived": false,937 "has_summary": false,938 "archetype": "regular",939 "slug": "given-a-tensorflow-model-how-do-i-convert-it-into-pytorch",940 "category_id": 1,941 "word_count": 65,942 "deleted_at": null,943 "user_id": 56614,944 "featured_link": null,945 "pinned_globally": false,946 "pinned_at": null,947 "pinned_until": null,948 "image_url": null,949 "slow_mode_seconds": 0,950 "draft": null,951 "draft_key": "topic_153648",952 "draft_sequence": null,953 "unpinned": null,954 "pinned": false,955 "current_post_number": 1,956 "highest_post_number": 2,957 "deleted_by": null,958 "actions_summary": [959 {960 "id": 4,961 "count": 0,962 "hidden": false,963 "can_act": false964 },965 {966 "id": 8,967 "count": 0,968 "hidden": false,969 "can_act": false970 },971 {972 "id": 10,973 "count": 0,974 "hidden": false,975 "can_act": false976 },977 {978 "id": 7,979 "count": 0,980 "hidden": false,981 "can_act": false982 }983 ],984 "chunk_size": 20,985 "bookmarked": false,986 "topic_timer": null,987 "message_bus_last_id": 0,988 "participant_count": 2,989 "show_read_indicator": false,990 "thumbnails": null,991 "slow_mode_enabled_until": null,992 "can_vote": false,993 "vote_count": 0,994 "user_voted": false,995 "discourse_zendesk_plugin_zendesk_id": null,996 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",997 "details": {998 "can_edit": false,999 "notification_level": 1,1000 "participants": [1001 {1002 "id": 3534,1003 "username": "ptrblck",1004 "name": "",1005 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1006 "post_count": 1,1007 "primary_group_name": null,1008 "flair_name": null,1009 "flair_url": null,1010 "flair_color": null,1011 "flair_bg_color": null,1012 "flair_group_id": null,1013 "admin": true,1014 "moderator": true,1015 "trust_level": 21016 },1017 {1018 "id": 56614,1019 "username": "Sumesh_Sankar",1020 "name": "Sumesh Sankar",1021 "avatar_template": "/user_avatar/discuss.pytorch.org/sumesh_sankar/{size}/45448_2.png",1022 "post_count": 1,1023 "primary_group_name": null,1024 "flair_name": null,1025 "flair_url": null,1026 "flair_color": null,1027 "flair_bg_color": null,1028 "flair_group_id": null,1029 "trust_level": 11030 }1031 ],1032 "created_by": {1033 "id": 56614,1034 "username": "Sumesh_Sankar",1035 "name": "Sumesh Sankar",1036 "avatar_template": "/user_avatar/discuss.pytorch.org/sumesh_sankar/{size}/45448_2.png"1037 },1038 "last_poster": {1039 "id": 3534,1040 "username": "ptrblck",1041 "name": "",1042 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"1043 }1044 },1045 "bookmarks": []1046 },1047 {1048 "post_stream": {1049 "posts": [1050 {1051 "id": 350645,1052 "name": "xiong xiong",1053 "username": "xiong_xiong",1054 "avatar_template": "/user_avatar/discuss.pytorch.org/xiong_xiong/{size}/31163_2.png",1055 "created_at": "2022-06-08T15:06:52.837Z",1056 "cooked": "<p>My problem is how to train different groups of parameters with an optimizer in PyTorch.<br>\nI have a basic fully-connected neural network with trainable weights and biases, and I have two special trainable parameters(lambda_1 and lambda_2), then I can get two groups of parameters. Group one includes weights and biases, group two includes<br>\nweights, biases, and lambda_1 and lambda_2. My goal is to put these two groups of parameters into an optimizer, respectively. I tried to implement it but failed. Here is My code.</p>\n<pre><code class=\"lang-auto\">print(\"group one: weight, biase\")\nfor p in model.parameter_wb():\n print(p)\n\nprint(\"\\n\")\nprint(\"group two: weight, biase and lambda\")\nfor p in model.parameter_wb_lambda():\n print(p)\n</code></pre>\n<p>Why model.parameter_wb() and model.parameter_wb_lambda() produce the same result(both of them produce parameters of group two. I hope to get two different groups of trainable parameters.</p>\n<pre><code class=\"lang-auto\">import torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom collections import OrderedDict\n\nclass FNN(torch.nn.Module):\n def __init__(self, layers):\n super(FNN, self).__init__()\n \n # parameters\n self.depth = len(layers) - 1\n \n # set up layer order dict\n # torch.nn.Tanhshrink/torch.nn.Tanh\n # torch.nn.functional.tanh\n self.activation = torch.nn.Tanh\n \n layer_list = list()\n for i in range(self.depth - 1): \n layer_list.append(\n ('layer_%d' % i, torch.nn.Linear(layers[i], layers[i+1]))\n )\n layer_list.append(('activation_%d' % i, self.activation()))\n \n layer_list.append(\n ('layer_%d' % (self.depth - 1), torch.nn.Linear(layers[-2], layers[-1]))\n )\n layerDict = OrderedDict(layer_list)\n \n # deploy layers\n self.layers = torch.nn.Sequential(layerDict)\n \n def forward(self, x):\n out = self.layers(x)\n return out\n\nclass Model():\n def __init__(self, layers, nn): \n self.nn = nn\n # deep neural networks\n self.layers = layers\n \n if self.nn == \"FNN\":\n self.multi_task_model = FNN(self.layers)\n\n # group 1: weight and biase\n self.parameter_wb = self.multi_task_model.parameters\n\n # another two trainable parameters\n self.lambda_1 = torch.tensor([0.0], requires_grad=True)\n self.lambda_2 = torch.tensor([-6.0], requires_grad=True)\n \n self.lambda_1 = torch.nn.Parameter(self.lambda_1)\n self.lambda_2 = torch.nn.Parameter(self.lambda_2)\n \n # register parameter\n self.multi_task_model.register_parameter('lambda_1', self.lambda_1)\n self.multi_task_model.register_parameter('lambda_2', self.lambda_2)\n\n # group 2: weight, biase and lambda\n self.parameter_wb_lambda = self.multi_task_model.parameters\n\nlayers = [1,3,3,2]\n\nnn = \"FNN\"\nmodel = Model(layers, nn)\n\nprint(\"print trainable parameter: weight, biase\")\nfor p in model.parameter_wb():\n print(p)\n\nprint(\"\\n\")\nprint(\"print trainable parameter: weight, biase and lambda\")\nfor p in model.parameter_wb_lambda():\n print(p)\n\n</code></pre>",1057 "post_number": 1,1058 "post_type": 1,1059 "posts_count": 3,1060 "updated_at": "2022-06-09T06:11:48.799Z",1061 "reply_count": 1,1062 "reply_to_post_number": null,1063 "quote_count": 0,1064 "incoming_link_count": 504,1065 "reads": 16,1066 "readers_count": 15,1067 "score": 2523.2,1068 "yours": false,1069 "topic_id": 153685,1070 "topic_slug": "how-to-put-different-groups-of-trainable-parameters-into-optimizer-in-pytorch",1071 "display_username": "xiong xiong",1072 "primary_group_name": null,1073 "flair_name": null,1074 "flair_url": null,1075 "flair_bg_color": null,1076 "flair_color": null,1077 "flair_group_id": null,1078 "badges_granted": [],1079 "version": 2,1080 "can_edit": false,1081 "can_delete": false,1082 "can_recover": false,1083 "can_see_hidden_post": false,1084 "can_wiki": false,1085 "read": true,1086 "user_title": null,1087 "bookmarked": false,1088 "actions_summary": [],1089 "moderator": false,1090 "admin": false,1091 "staff": false,1092 "user_id": 39028,1093 "hidden": false,1094 "trust_level": 0,1095 "deleted_at": null,1096 "user_deleted": false,1097 "edit_reason": null,1098 "can_view_edit_history": true,1099 "wiki": false,1100 "post_url": "/t/how-to-put-different-groups-of-trainable-parameters-into-optimizer-in-pytorch/153685/1",1101 "can_accept_answer": false,1102 "can_unaccept_answer": false,1103 "accepted_answer": false,1104 "topic_accepted_answer": null,1105 "can_vote": false1106 },1107 {1108 "id": 350731,1109 "name": "K. Frank",1110 "username": "KFrank",1111 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",1112 "created_at": "2022-06-09T04:09:19.784Z",1113 "cooked": "<p>Hi Xiong!</p>\n<aside class=\"quote no-group quote-modified\" data-username=\"xiong_xiong\" data-post=\"1\" data-topic=\"153685\" data-full=\"true\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/xiong_xiong/48/31163_2.png\" class=\"avatar\"> xiong_xiong:</div>\n<blockquote>\n<p>Why model.parameter_wb() and model.parameter_wb_lambda() produce the same result</p>\n<pre><code class=\"lang-auto\"> # group 1: weight and biase\n self.parameter_wb = self.multi_task_model.parameters\n...\n # register parameter\n self.multi_task_model.register_parameter('lambda_1', self.lambda_1)\n self.multi_task_model.register_parameter('lambda_2', self.lambda_2)\n\n # group 2: weight, biase and lambda\n self.parameter_wb_lambda = self.multi_task_model.parameters\n</code></pre>\n</blockquote>\n</aside>\n<p>Your problem is that:</p>\n<pre data-code-wrap=\"python\"><code class=\"lang-python\"> self.parameter_wb = self.multi_task_model.parameters\n</code></pre>\n<p>assigns the <code>parameters</code> method of your <code>multi_task_model</code> to<br>\n<code>parameter_wb</code>, but doesn’t <em>evaluate</em> that method.</p>\n<p>Then:</p>\n<pre data-code-wrap=\"python\"><code class=\"lang-python\"> self.parameter_wb_lambda = self.multi_task_model.parameters\n</code></pre>\n<p>assigns that <em>same</em> method to <code>parameter_wb_lambda</code>, again without<br>\nevaluating it. It doesn’t matter that you registered two more <code>Parameter</code>s<br>\nin between the two assignments.</p>\n<p>It’s only when you later call:</p>\n<pre data-code-wrap=\"python\"><code class=\"lang-python\">for p in model.parameter_wb():\n# and\nfor p in model.parameter_wb_lambda():\n</code></pre>\n<p>that the <code>parameters</code> method is actually evaluated and it returns, both<br>\ntimes, the (generator for the) list of all of the <code>Parameter</code>s that have been<br>\nregistered <em>at the time</em> of evaluation.</p>\n<p>Best.</p>\n<p>K. Frank</p>",1114 "post_number": 2,1115 "post_type": 1,1116 "posts_count": 3,1117 "updated_at": "2022-06-09T04:09:19.784Z",1118 "reply_count": 0,1119 "reply_to_post_number": null,1120 "quote_count": 1,1121 "incoming_link_count": 4,1122 "reads": 13,1123 "readers_count": 12,1124 "score": 22.6,1125 "yours": false,1126 "topic_id": 153685,1127 "topic_slug": "how-to-put-different-groups-of-trainable-parameters-into-optimizer-in-pytorch",1128 "display_username": "K. Frank",1129 "primary_group_name": null,1130 "flair_name": null,1131 "flair_url": null,1132 "flair_bg_color": null,1133 "flair_color": null,1134 "flair_group_id": null,1135 "badges_granted": [],1136 "version": 1,1137 "can_edit": false,1138 "can_delete": false,1139 "can_recover": false,1140 "can_see_hidden_post": false,1141 "can_wiki": false,1142 "read": true,1143 "user_title": null,1144 "bookmarked": false,1145 "actions_summary": [],1146 "moderator": false,1147 "admin": false,1148 "staff": false,1149 "user_id": 18088,1150 "hidden": false,1151 "trust_level": 2,1152 "deleted_at": null,1153 "user_deleted": false,1154 "edit_reason": null,1155 "can_view_edit_history": true,1156 "wiki": false,1157 "post_url": "/t/how-to-put-different-groups-of-trainable-parameters-into-optimizer-in-pytorch/153685/2",1158 "can_accept_answer": false,1159 "can_unaccept_answer": false,1160 "accepted_answer": false,1161 "topic_accepted_answer": null1162 },1163 {1164 "id": 350734,1165 "name": "xiong xiong",1166 "username": "xiong_xiong",1167 "avatar_template": "/user_avatar/discuss.pytorch.org/xiong_xiong/{size}/31163_2.png",1168 "created_at": "2022-06-09T04:27:52.611Z",1169 "cooked": "<p>Hi, Frank, thank you so much for your nice answer. I understand the reason for the same result produced by</p>\n<pre><code class=\"lang-auto\">for p in model.parameter_wb():\n# and\nfor p in model.parameter_wb_lambda():\n</code></pre>\n<p>I hope to pass different groups of parameters into an optimizer. I hope that self.parameter_wb() will produce weights and biases, and self.parameter_wb_var() will produce weights, biases, and lambda_1 and lambda_2. Then I can get two different optimizers. I have no idea how to implement this. Could you please give some advice?<br>\nThank you so much anyway.</p>\n<pre><code class=\"lang-auto\">self.optimizer_1 = optim.Adam(self.parameter_wb(), lr=0.001)\nself.optimizer_2 = optim.Adam(self.parameter_wb_var(), lr=0.001)\n</code></pre>",1170 "post_number": 3,1171 "post_type": 1,1172 "posts_count": 3,1173 "updated_at": "2022-06-09T04:29:02.677Z",1174 "reply_count": 0,1175 "reply_to_post_number": 2,1176 "quote_count": 0,1177 "incoming_link_count": 3,1178 "reads": 9,1179 "readers_count": 8,1180 "score": 16.8,1181 "yours": false,1182 "topic_id": 153685,1183 "topic_slug": "how-to-put-different-groups-of-trainable-parameters-into-optimizer-in-pytorch",1184 "display_username": "xiong xiong",1185 "primary_group_name": null,1186 "flair_name": null,1187 "flair_url": null,1188 "flair_bg_color": null,1189 "flair_color": null,1190 "flair_group_id": null,1191 "badges_granted": [],1192 "version": 1,1193 "can_edit": false,1194 "can_delete": false,1195 "can_recover": false,1196 "can_see_hidden_post": false,1197 "can_wiki": false,1198 "read": true,1199 "user_title": null,1200 "reply_to_user": {