Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 264932,7 "name": "J Johnson",8 "username": "J_Johnson",9 "avatar_template": "/user_avatar/discuss.pytorch.org/j_johnson/{size}/55494_2.png",10 "created_at": "2021-02-21T12:33:41.521Z",11 "cooked": "<p>I’m curious what the reasoning is for having the hidden vector(s) of RNNs input by the user and managed outside of the object architecture.</p>\n<p>Are there any plans to automate it’s creation within the RNN object at a future date?</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 1,15 "updated_at": "2021-02-21T12:33:41.521Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 10,20 "reads": 7,21 "readers_count": 6,22 "score": 51.4,23 "yours": false,24 "topic_id": 112497,25 "topic_slug": "rnn-hidden-layer-question",26 "display_username": "J Johnson",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": 41458,48 "hidden": false,49 "trust_level": 2,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/rnn-hidden-layer-question/112497/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 "stream": [64 26493265 ]66 },67 "timeline_lookup": [68 [69 1,70 170771 ]72 ],73 "suggested_topics": [74 {75 "fancy_title": "Seeking advice on computing backprop step by chunks",76 "id": 212924,77 "title": "Seeking advice on computing backprop step by chunks",78 "slug": "seeking-advice-on-computing-backprop-step-by-chunks",79 "posts_count": 2,80 "reply_count": 0,81 "highest_post_number": 2,82 "image_url": null,83 "created_at": "2024-11-13T12:28:34.725Z",84 "last_posted_at": "2024-11-14T14:09:04.532Z",85 "bumped": true,86 "bumped_at": "2024-11-14T14:09:04.532Z",87 "archetype": "regular",88 "unseen": false,89 "pinned": false,90 "unpinned": null,91 "visible": true,92 "closed": false,93 "archived": false,94 "bookmarked": null,95 "liked": null,96 "tags_descriptions": {},97 "like_count": 0,98 "views": 36,99 "category_id": 1,100 "featured_link": null,101 "has_accepted_answer": true,102 "posters": [103 {104 "extras": "latest single",105 "description": "Original Poster, Most Recent Poster, Accepted Answer",106 "user": {107 "id": 80885,108 "username": "meditans",109 "name": "",110 "avatar_template": "/user_avatar/discuss.pytorch.org/meditans/{size}/73976_2.png",111 "trust_level": 1112 }113 }114 ]115 },116 {117 "fancy_title": "Will profiler.record_function be affected by the asynchronous execution?",118 "id": 214993,119 "title": "Will profiler.record_function be affected by the asynchronous execution?",120 "slug": "will-profiler-record-function-be-affected-by-the-asynchronous-execution",121 "posts_count": 2,122 "reply_count": 0,123 "highest_post_number": 2,124 "image_url": null,125 "created_at": "2025-01-05T09:31:28.370Z",126 "last_posted_at": "2025-01-05T19:46:14.748Z",127 "bumped": true,128 "bumped_at": "2025-01-05T19:46:14.748Z",129 "archetype": "regular",130 "unseen": false,131 "pinned": false,132 "unpinned": null,133 "visible": true,134 "closed": false,135 "archived": false,136 "bookmarked": null,137 "liked": null,138 "tags_descriptions": {},139 "like_count": 0,140 "views": 41,141 "category_id": 1,142 "featured_link": null,143 "has_accepted_answer": false,144 "posters": [145 {146 "extras": null,147 "description": "Original Poster",148 "user": {149 "id": 81887,150 "username": "ideaV",151 "name": "",152 "avatar_template": "/user_avatar/discuss.pytorch.org/ideav/{size}/74914_2.png",153 "trust_level": 1154 }155 },156 {157 "extras": "latest",158 "description": "Most Recent Poster",159 "user": {160 "id": 41396,161 "username": "soulitzer",162 "name": "",163 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",164 "trust_level": 2165 }166 }167 ]168 },169 {170 "fancy_title": "Does torch.compile guarantee that the generated fusion strategy and Triton kernel are the same every time?",171 "id": 217095,172 "title": "Does torch.compile guarantee that the generated fusion strategy and Triton kernel are the same every time?",173 "slug": "does-torch-compile-guarantee-that-the-generated-fusion-strategy-and-triton-kernel-are-the-same-every-time",174 "posts_count": 2,175 "reply_count": 0,176 "highest_post_number": 2,177 "image_url": null,178 "created_at": "2025-02-24T13:48:45.414Z",179 "last_posted_at": "2025-02-24T13:56:52.728Z",180 "bumped": true,181 "bumped_at": "2025-02-24T13:56:52.728Z",182 "archetype": "regular",183 "unseen": false,184 "pinned": false,185 "unpinned": null,186 "visible": true,187 "closed": false,188 "archived": false,189 "bookmarked": null,190 "liked": null,191 "tags_descriptions": {},192 "like_count": 0,193 "views": 32,194 "category_id": 1,195 "featured_link": null,196 "has_accepted_answer": false,197 "posters": [198 {199 "extras": null,200 "description": "Original Poster",201 "user": {202 "id": 82892,203 "username": "toddlt",204 "name": "toddlt",205 "avatar_template": "/user_avatar/discuss.pytorch.org/toddlt/{size}/75846_2.png",206 "trust_level": 1207 }208 },209 {210 "extras": "latest",211 "description": "Most Recent Poster",212 "user": {213 "id": 3534,214 "username": "ptrblck",215 "name": "",216 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",217 "admin": true,218 "moderator": true,219 "trust_level": 2220 }221 }222 ]223 },224 {225 "fancy_title": "Warmup on a side stream",226 "id": 217207,227 "title": "Warmup on a side stream",228 "slug": "warmup-on-a-side-stream",229 "posts_count": 1,230 "reply_count": 0,231 "highest_post_number": 1,232 "image_url": null,233 "created_at": "2025-02-26T22:56:54.755Z",234 "last_posted_at": "2025-02-26T22:56:54.799Z",235 "bumped": true,236 "bumped_at": "2025-02-26T22:56:54.799Z",237 "archetype": "regular",238 "unseen": false,239 "pinned": false,240 "unpinned": null,241 "visible": true,242 "closed": false,243 "archived": false,244 "bookmarked": null,245 "liked": null,246 "tags_descriptions": {},247 "like_count": 0,248 "views": 41,249 "category_id": 1,250 "featured_link": null,251 "has_accepted_answer": false,252 "posters": [253 {254 "extras": "latest single",255 "description": "Original Poster, Most Recent Poster",256 "user": {257 "id": 19099,258 "username": "dskhudia",259 "name": "Daya Khudia",260 "avatar_template": "/letter_avatar_proxy/v4/letter/d/ebca7d/{size}.png",261 "trust_level": 2262 }263 }264 ]265 },266 {267 "fancy_title": "How does the torch.profiler measure memory?",268 "id": 217391,269 "title": "How does the torch.profiler measure memory?",270 "slug": "how-does-the-torch-profiler-measure-memory",271 "posts_count": 1,272 "reply_count": 0,273 "highest_post_number": 1,274 "image_url": null,275 "created_at": "2025-03-03T17:37:58.369Z",276 "last_posted_at": "2025-03-03T17:37:58.409Z",277 "bumped": true,278 "bumped_at": "2025-03-03T17:37:58.409Z",279 "archetype": "regular",280 "unseen": false,281 "pinned": false,282 "unpinned": null,283 "visible": true,284 "closed": false,285 "archived": false,286 "bookmarked": null,287 "liked": null,288 "tags_descriptions": {},289 "like_count": 0,290 "views": 34,291 "category_id": 1,292 "featured_link": null,293 "has_accepted_answer": false,294 "posters": [295 {296 "extras": "latest single",297 "description": "Original Poster, Most Recent Poster",298 "user": {299 "id": 83044,300 "username": "MirkoDeVita98",301 "name": "Mirko De Vita",302 "avatar_template": "/user_avatar/discuss.pytorch.org/mirkodevita98/{size}/75965_2.png",303 "trust_level": 1304 }305 }306 ]307 }308 ],309 "tags_descriptions": {},310 "fancy_title": "RNN Hidden Layer Question",311 "id": 112497,312 "title": "RNN Hidden Layer Question",313 "posts_count": 1,314 "created_at": "2021-02-21T12:33:41.467Z",315 "views": 335,316 "reply_count": 0,317 "like_count": 0,318 "last_posted_at": "2021-02-21T12:33:41.521Z",319 "visible": true,320 "closed": false,321 "archived": false,322 "has_summary": false,323 "archetype": "regular",324 "slug": "rnn-hidden-layer-question",325 "category_id": 1,326 "word_count": 43,327 "deleted_at": null,328 "user_id": 41458,329 "featured_link": null,330 "pinned_globally": false,331 "pinned_at": null,332 "pinned_until": null,333 "image_url": null,334 "slow_mode_seconds": 0,335 "draft": null,336 "draft_key": "topic_112497",337 "draft_sequence": null,338 "unpinned": null,339 "pinned": false,340 "current_post_number": 1,341 "highest_post_number": 1,342 "deleted_by": null,343 "actions_summary": [344 {345 "id": 4,346 "count": 0,347 "hidden": false,348 "can_act": false349 },350 {351 "id": 8,352 "count": 0,353 "hidden": false,354 "can_act": false355 },356 {357 "id": 10,358 "count": 0,359 "hidden": false,360 "can_act": false361 },362 {363 "id": 7,364 "count": 0,365 "hidden": false,366 "can_act": false367 }368 ],369 "chunk_size": 20,370 "bookmarked": false,371 "topic_timer": null,372 "message_bus_last_id": 0,373 "participant_count": 1,374 "show_read_indicator": false,375 "thumbnails": null,376 "slow_mode_enabled_until": null,377 "can_vote": false,378 "vote_count": 0,379 "user_voted": false,380 "discourse_zendesk_plugin_zendesk_id": null,381 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",382 "details": {383 "can_edit": false,384 "notification_level": 1,385 "participants": [386 {387 "id": 41458,388 "username": "J_Johnson",389 "name": "J Johnson",390 "avatar_template": "/user_avatar/discuss.pytorch.org/j_johnson/{size}/55494_2.png",391 "post_count": 1,392 "primary_group_name": null,393 "flair_name": null,394 "flair_url": null,395 "flair_color": null,396 "flair_bg_color": null,397 "flair_group_id": null,398 "trust_level": 2399 }400 ],401 "created_by": {402 "id": 41458,403 "username": "J_Johnson",404 "name": "J Johnson",405 "avatar_template": "/user_avatar/discuss.pytorch.org/j_johnson/{size}/55494_2.png"406 },407 "last_poster": {408 "id": 41458,409 "username": "J_Johnson",410 "name": "J Johnson",411 "avatar_template": "/user_avatar/discuss.pytorch.org/j_johnson/{size}/55494_2.png"412 }413 },414 "bookmarks": []415 },416 {417 "post_stream": {418 "posts": [419 {420 "id": 264832,421 "name": "Mohamed Farag",422 "username": "Mohamed_Farag",423 "avatar_template": "/user_avatar/discuss.pytorch.org/mohamed_farag/{size}/34888_2.png",424 "created_at": "2021-02-20T16:17:18.410Z",425 "cooked": "<p>I started to learn about <strong>pytorch l</strong>ately after using <strong>tensorflow</strong> for almost 1 year, i am confused about something:</p>\n<p>In <strong>Tensorflow</strong> when we have multiclassification problem we set at the last activation layer the number of classes and the <em><strong>type of activation function which is \"Softmax</strong></em>\" and using <em>“Cross-entropy loss”</em></p>\n<p>so in <strong>Pytorch</strong> when building a network we set last layer to nn.linear().</p>\n<p>can anyone clarify the concept?</p>\n<p>Thanks a lot. <img src=\"https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9\" title=\":slight_smile:\" class=\"emoji\" alt=\":slight_smile:\"></p>",426 "post_number": 1,427 "post_type": 1,428 "posts_count": 6,429 "updated_at": "2021-02-20T16:17:18.410Z",430 "reply_count": 0,431 "reply_to_post_number": null,432 "quote_count": 0,433 "incoming_link_count": 1863,434 "reads": 25,435 "readers_count": 24,436 "score": 9290.0,437 "yours": false,438 "topic_id": 112445,439 "topic_slug": "multi-classification-activation-function-for-last-layer",440 "display_username": "Mohamed Farag",441 "primary_group_name": null,442 "flair_name": null,443 "flair_url": null,444 "flair_bg_color": null,445 "flair_color": null,446 "flair_group_id": null,447 "badges_granted": [],448 "version": 1,449 "can_edit": false,450 "can_delete": false,451 "can_recover": false,452 "can_see_hidden_post": false,453 "can_wiki": false,454 "read": true,455 "user_title": null,456 "bookmarked": false,457 "actions_summary": [],458 "moderator": false,459 "admin": false,460 "staff": false,461 "user_id": 42293,462 "hidden": false,463 "trust_level": 1,464 "deleted_at": null,465 "user_deleted": false,466 "edit_reason": null,467 "can_view_edit_history": true,468 "wiki": false,469 "post_url": "/t/multi-classification-activation-function-for-last-layer/112445/1",470 "can_accept_answer": false,471 "can_unaccept_answer": false,472 "accepted_answer": false,473 "topic_accepted_answer": true,474 "can_vote": false475 },476 {477 "id": 264835,478 "name": "Dwight Foster",479 "username": "Dwight_Foster",480 "avatar_template": "/user_avatar/discuss.pytorch.org/dwight_foster/{size}/18182_2.png",481 "created_at": "2021-02-20T17:59:03.636Z",482 "cooked": "<p>Basically in pytorch the cross entropy loss function combines a softmax and nllloss function into one. So for training you end up not needing to add a softmax function to the model because it is just computed in the loss function. However for predicting values with your model you would have to use a softmax function. You can also include a softmax function in your model and just use the nllloss function and it would do the same thing.</p>",483 "post_number": 2,484 "post_type": 1,485 "posts_count": 6,486 "updated_at": "2021-02-20T17:59:03.636Z",487 "reply_count": 2,488 "reply_to_post_number": null,489 "quote_count": 0,490 "incoming_link_count": 11,491 "reads": 25,492 "readers_count": 24,493 "score": 85.0,494 "yours": false,495 "topic_id": 112445,496 "topic_slug": "multi-classification-activation-function-for-last-layer",497 "display_username": "Dwight Foster",498 "primary_group_name": null,499 "flair_name": null,500 "flair_url": null,501 "flair_bg_color": null,502 "flair_color": null,503 "flair_group_id": null,504 "badges_granted": [],505 "version": 1,506 "can_edit": false,507 "can_delete": false,508 "can_recover": false,509 "can_see_hidden_post": false,510 "can_wiki": false,511 "read": true,512 "user_title": null,513 "bookmarked": false,514 "actions_summary": [515 {516 "id": 2,517 "count": 1518 }519 ],520 "moderator": false,521 "admin": false,522 "staff": false,523 "user_id": 24864,524 "hidden": false,525 "trust_level": 2,526 "deleted_at": null,527 "user_deleted": false,528 "edit_reason": null,529 "can_view_edit_history": true,530 "wiki": false,531 "post_url": "/t/multi-classification-activation-function-for-last-layer/112445/2",532 "can_accept_answer": false,533 "can_unaccept_answer": false,534 "accepted_answer": false,535 "topic_accepted_answer": true536 },537 {538 "id": 264880,539 "name": "K. Frank",540 "username": "KFrank",541 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",542 "created_at": "2021-02-21T02:52:17.363Z",543 "cooked": "<p>Hi Dwight and Mohamed!</p>\n<p>I would like to offer two clarifications:</p>\n<aside class=\"quote no-group\" data-username=\"Dwight_Foster\" data-post=\"2\" data-topic=\"112445\" 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/dwight_foster/48/18182_2.png\" class=\"avatar\"> Dwight_Foster:</div>\n<blockquote>\n<p>However for predicting values with your model you would have to use a softmax function.</p>\n</blockquote>\n</aside>\n<p>If by “predicting values” you mean predicting class labels, this is not<br>\ntrue. To get a predicted class label from the probabilities returned by<br>\n<code>softamx()</code> you take <code>argmax()</code>. But <code>softmax()</code> does not change the<br>\norder of the values, so you can just as well take <code>argmax()</code> of the logits<br>\nyou would have input to <code>softmax()</code>. That is, you can skip <code>softmax()</code><br>\naltogether.</p>\n<aside class=\"quote no-group\">\n<blockquote>\n<p>You can also include a softmax function in your model and just use the nllloss function and it would do the same thing.</p>\n</blockquote>\n</aside>\n<p>This is not quite right. You would need to use pytorch’s <code>log_softmax()</code><br>\nfollowed by <code>nll_loss()</code> to reproduce pytorch’s <code>cross_entropy()</code>.</p>\n<p>Best.</p>\n<p>K. Frank</p>",544 "post_number": 3,545 "post_type": 1,546 "posts_count": 6,547 "updated_at": "2021-02-21T02:52:17.363Z",548 "reply_count": 1,549 "reply_to_post_number": 2,550 "quote_count": 1,551 "incoming_link_count": 12,552 "reads": 23,553 "readers_count": 22,554 "score": 129.6,555 "yours": false,556 "topic_id": 112445,557 "topic_slug": "multi-classification-activation-function-for-last-layer",558 "display_username": "K. Frank",559 "primary_group_name": null,560 "flair_name": null,561 "flair_url": null,562 "flair_bg_color": null,563 "flair_color": null,564 "flair_group_id": null,565 "badges_granted": [],566 "version": 1,567 "can_edit": false,568 "can_delete": false,569 "can_recover": false,570 "can_see_hidden_post": false,571 "can_wiki": false,572 "read": true,573 "user_title": null,574 "bookmarked": false,575 "actions_summary": [576 {577 "id": 2,578 "count": 2579 }580 ],581 "moderator": false,582 "admin": false,583 "staff": false,584 "user_id": 18088,585 "hidden": false,586 "trust_level": 2,587 "deleted_at": null,588 "user_deleted": false,589 "edit_reason": null,590 "can_view_edit_history": true,591 "wiki": false,592 "post_url": "/t/multi-classification-activation-function-for-last-layer/112445/3",593 "can_accept_answer": false,594 "can_unaccept_answer": false,595 "accepted_answer": true,596 "topic_accepted_answer": true597 },598 {599 "id": 264920,600 "name": "Mohamed Farag",601 "username": "Mohamed_Farag",602 "avatar_template": "/user_avatar/discuss.pytorch.org/mohamed_farag/{size}/34888_2.png",603 "created_at": "2021-02-21T10:20:24.567Z",604 "cooked": "<p>Thank you a lot!<br>\ni will try both ideas <img src=\"https://discuss.pytorch.org/images/emoji/apple/blush.png?v=9\" title=\":blush:\" class=\"emoji\" alt=\":blush:\"></p>",605 "post_number": 4,606 "post_type": 1,607 "posts_count": 6,608 "updated_at": "2021-02-21T10:20:24.567Z",609 "reply_count": 0,610 "reply_to_post_number": 2,611 "quote_count": 0,612 "incoming_link_count": 7,613 "reads": 19,614 "readers_count": 18,615 "score": 38.8,616 "yours": false,617 "topic_id": 112445,618 "topic_slug": "multi-classification-activation-function-for-last-layer",619 "display_username": "Mohamed Farag",620 "primary_group_name": null,621 "flair_name": null,622 "flair_url": null,623 "flair_bg_color": null,624 "flair_color": null,625 "flair_group_id": null,626 "badges_granted": [],627 "version": 1,628 "can_edit": false,629 "can_delete": false,630 "can_recover": false,631 "can_see_hidden_post": false,632 "can_wiki": false,633 "read": true,634 "user_title": null,635 "reply_to_user": {636 "id": 24864,637 "username": "Dwight_Foster",638 "name": "Dwight Foster",639 "avatar_template": "/user_avatar/discuss.pytorch.org/dwight_foster/{size}/18182_2.png"640 },641 "bookmarked": false,642 "actions_summary": [],643 "moderator": false,644 "admin": false,645 "staff": false,646 "user_id": 42293,647 "hidden": false,648 "trust_level": 1,649 "deleted_at": null,650 "user_deleted": false,651 "edit_reason": null,652 "can_view_edit_history": true,653 "wiki": false,654 "post_url": "/t/multi-classification-activation-function-for-last-layer/112445/4",655 "can_accept_answer": false,656 "can_unaccept_answer": false,657 "accepted_answer": false,658 "topic_accepted_answer": true659 },660 {661 "id": 264921,662 "name": "Mohamed Farag",663 "username": "Mohamed_Farag",664 "avatar_template": "/user_avatar/discuss.pytorch.org/mohamed_farag/{size}/34888_2.png",665 "created_at": "2021-02-21T10:22:06.393Z",666 "cooked": "<p>Thank you a lot K.Frank <img src=\"https://discuss.pytorch.org/images/emoji/apple/smiling_face_with_three_hearts.png?v=9\" title=\":smiling_face_with_three_hearts:\" class=\"emoji\" alt=\":smiling_face_with_three_hearts:\"><br>\nI will try today.</p>",667 "post_number": 5,668 "post_type": 1,669 "posts_count": 6,670 "updated_at": "2021-02-21T10:22:06.393Z",671 "reply_count": 0,672 "reply_to_post_number": 3,673 "quote_count": 0,674 "incoming_link_count": 4,675 "reads": 18,676 "readers_count": 17,677 "score": 23.6,678 "yours": false,679 "topic_id": 112445,680 "topic_slug": "multi-classification-activation-function-for-last-layer",681 "display_username": "Mohamed Farag",682 "primary_group_name": null,683 "flair_name": null,684 "flair_url": null,685 "flair_bg_color": null,686 "flair_color": null,687 "flair_group_id": null,688 "badges_granted": [],689 "version": 1,690 "can_edit": false,691 "can_delete": false,692 "can_recover": false,693 "can_see_hidden_post": false,694 "can_wiki": false,695 "read": true,696 "user_title": null,697 "reply_to_user": {698 "id": 18088,699 "username": "KFrank",700 "name": "K. Frank",701 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png"702 },703 "bookmarked": false,704 "actions_summary": [],705 "moderator": false,706 "admin": false,707 "staff": false,708 "user_id": 42293,709 "hidden": false,710 "trust_level": 1,711 "deleted_at": null,712 "user_deleted": false,713 "edit_reason": null,714 "can_view_edit_history": true,715 "wiki": false,716 "post_url": "/t/multi-classification-activation-function-for-last-layer/112445/5",717 "can_accept_answer": false,718 "can_unaccept_answer": false,719 "accepted_answer": false,720 "topic_accepted_answer": true721 },722 {723 "id": 264926,724 "name": "Mohamed Farag",725 "username": "Mohamed_Farag",726 "avatar_template": "/user_avatar/discuss.pytorch.org/mohamed_farag/{size}/34888_2.png",727 "created_at": "2021-02-21T10:53:47.929Z",728 "cooked": "<p>I have another question what about using nn.softmax() instead of log_softmax() with nll_loss()?</p>\n<p>i saw documentation about the first fuchtion, will it work ?</p>",729 "post_number": 7,730 "post_type": 1,731 "posts_count": 6,732 "updated_at": "2021-02-21T10:53:47.929Z",733 "reply_count": 0,734 "reply_to_post_number": null,735 "quote_count": 0,736 "incoming_link_count": 10,737 "reads": 16,738 "readers_count": 15,739 "score": 53.2,740 "yours": false,741 "topic_id": 112445,742 "topic_slug": "multi-classification-activation-function-for-last-layer",743 "display_username": "Mohamed Farag",744 "primary_group_name": null,745 "flair_name": null,746 "flair_url": null,747 "flair_bg_color": null,748 "flair_color": null,749 "flair_group_id": null,750 "badges_granted": [],751 "version": 1,752 "can_edit": false,753 "can_delete": false,754 "can_recover": false,755 "can_see_hidden_post": false,756 "can_wiki": false,757 "read": true,758 "user_title": null,759 "bookmarked": false,760 "actions_summary": [],761 "moderator": false,762 "admin": false,763 "staff": false,764 "user_id": 42293,765 "hidden": false,766 "trust_level": 1,767 "deleted_at": null,768 "user_deleted": false,769 "edit_reason": null,770 "can_view_edit_history": true,771 "wiki": false,772 "post_url": "/t/multi-classification-activation-function-for-last-layer/112445/7",773 "can_accept_answer": false,774 "can_unaccept_answer": false,775 "accepted_answer": false,776 "topic_accepted_answer": true777 }778 ],779 "stream": [780 264832,781 264835,782 264880,783 264920,784 264921,785 264926786 ]787 },788 "timeline_lookup": [789 [790 1,791 1708792 ],793 [794 4,795 1707796 ]797 ],798 "suggested_topics": [799 {800 "fancy_title": "Can I ask for feedback on a custom-built PyTorch (CUDA 12.8 / RTX 5070 Ti)?",801 "id": 218174,802 "title": "Can I ask for feedback on a custom-built PyTorch (CUDA 12.8 / RTX 5070 Ti)?",803 "slug": "can-i-ask-for-feedback-on-a-custom-built-pytorch-cuda-12-8-rtx-5070-ti",804 "posts_count": 3,805 "reply_count": 1,806 "highest_post_number": 3,807 "image_url": null,808 "created_at": "2025-03-23T16:37:54.914Z",809 "last_posted_at": "2025-03-23T17:21:47.469Z",810 "bumped": true,811 "bumped_at": "2025-03-23T17:21:47.469Z",812 "archetype": "regular",813 "unseen": false,814 "pinned": false,815 "unpinned": null,816 "visible": true,817 "closed": false,818 "archived": false,819 "bookmarked": null,820 "liked": null,821 "tags_descriptions": {},822 "like_count": 0,823 "views": 385,824 "category_id": 1,825 "featured_link": null,826 "has_accepted_answer": false,827 "posters": [828 {829 "extras": "latest",830 "description": "Original Poster, Most Recent Poster",831 "user": {832 "id": 83428,833 "username": "gradiuse",834 "name": "hcc1shot",835 "avatar_template": "/user_avatar/discuss.pytorch.org/gradiuse/{size}/76303_2.png",836 "trust_level": 0837 }838 },839 {840 "extras": null,841 "description": "Frequent Poster",842 "user": {843 "id": 3534,844 "username": "ptrblck",845 "name": "",846 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",847 "admin": true,848 "moderator": true,849 "trust_level": 2850 }851 }852 ]853 },854 {855 "fancy_title": "Bad reconstruction with LSTM",856 "id": 216219,857 "title": "Bad reconstruction with LSTM",858 "slug": "bad-reconstruction-with-lstm",859 "posts_count": 4,860 "reply_count": 2,861 "highest_post_number": 4,862 "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/2/3/23dee189b147ed111b28042b030e4eba7fc1f2c4.png",863 "created_at": "2025-02-04T12:57:11.273Z",864 "last_posted_at": "2025-02-05T21:33:55.567Z",865 "bumped": true,866 "bumped_at": "2025-02-05T21:33:55.567Z",867 "archetype": "regular",868 "unseen": false,869 "pinned": false,870 "unpinned": null,871 "visible": true,872 "closed": false,873 "archived": false,874 "bookmarked": null,875 "liked": null,876 "tags_descriptions": {},877 "like_count": 0,878 "views": 182,879 "category_id": 1,880 "featured_link": null,881 "has_accepted_answer": false,882 "posters": [883 {884 "extras": "latest single",885 "description": "Original Poster, Most Recent Poster",886 "user": {887 "id": 82476,888 "username": "remy",889 "name": "",890 "avatar_template": "/letter_avatar_proxy/v4/letter/r/71e660/{size}.png",891 "trust_level": 1892 }893 }894 ]895 },896 {897 "fancy_title": "Has no gradient in bias",898 "id": 213235,899 "title": "Has no gradient in bias",900 "slug": "has-no-gradient-in-bias",901 "posts_count": 2,902 "reply_count": 0,903 "highest_post_number": 2,904 "image_url": null,905 "created_at": "2024-11-20T22:30:42.969Z",906 "last_posted_at": "2024-11-21T06:11:05.813Z",907 "bumped": true,908 "bumped_at": "2024-11-21T06:11:05.813Z",909 "archetype": "regular",910 "unseen": false,911 "pinned": false,912 "unpinned": null,913 "visible": true,914 "closed": false,915 "archived": false,916 "bookmarked": null,917 "liked": null,918 "tags_descriptions": {},919 "like_count": 0,920 "views": 105,921 "category_id": 1,922 "featured_link": null,923 "has_accepted_answer": false,924 "posters": [925 {926 "extras": null,927 "description": "Original Poster",928 "user": {929 "id": 81034,930 "username": "olegkufa",931 "name": "olegkufa",932 "avatar_template": "/user_avatar/discuss.pytorch.org/olegkufa/{size}/74104_2.png",933 "trust_level": 1934 }935 },936 {937 "extras": "latest",938 "description": "Most Recent Poster",939 "user": {940 "id": 3534,941 "username": "ptrblck",942 "name": "",943 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",944 "admin": true,945 "moderator": true,946 "trust_level": 2947 }948 }949 ]950 },951 {952 "fancy_title": "Is there any efficient way to build a dataset from zip archive file?",953 "id": 217690,954 "title": "Is there any efficient way to build a dataset from zip archive file?",955 "slug": "is-there-any-efficient-way-to-build-a-dataset-from-zip-archive-file",956 "posts_count": 1,957 "reply_count": 0,958 "highest_post_number": 1,959 "image_url": null,960 "created_at": "2025-03-11T09:42:48.063Z",961 "last_posted_at": "2025-03-11T09:42:48.107Z",962 "bumped": true,963 "bumped_at": "2025-03-11T09:42:48.107Z",964 "archetype": "regular",965 "unseen": false,966 "pinned": false,967 "unpinned": null,968 "visible": true,969 "closed": false,970 "archived": false,971 "bookmarked": null,972 "liked": null,973 "tags_descriptions": {},974 "like_count": 0,975 "views": 24,976 "category_id": 1,977 "featured_link": null,978 "has_accepted_answer": false,979 "posters": [980 {981 "extras": "latest single",982 "description": "Original Poster, Most Recent Poster",983 "user": {984 "id": 23907,985 "username": "Eta_C",986 "name": "",987 "avatar_template": "/user_avatar/discuss.pytorch.org/eta_c/{size}/17667_2.png",988 "trust_level": 2989 }990 }991 ]992 },993 {994 "fancy_title": "Why does not my code cause the error ‘element 0 of tensors does not require grad and does not have a grad_fn’",995 "id": 218268,996 "title": "Why does not my code cause the error 'element 0 of tensors does not require grad and does not have a grad_fn'",997 "slug": "why-does-not-my-code-cause-the-error-element-0-of-tensors-does-not-require-grad-and-does-not-have-a-grad-fn",998 "posts_count": 2,999 "reply_count": 0,1000 "highest_post_number": 2,1001 "image_url": null,1002 "created_at": "2025-03-26T02:15:00.792Z",1003 "last_posted_at": "2025-03-26T02:29:45.907Z",1004 "bumped": true,1005 "bumped_at": "2025-03-26T02:29:45.907Z",1006 "archetype": "regular",1007 "unseen": false,1008 "pinned": false,1009 "unpinned": null,1010 "visible": true,1011 "closed": false,1012 "archived": false,1013 "bookmarked": null,1014 "liked": null,1015 "tags_descriptions": {},1016 "like_count": 0,1017 "views": 45,1018 "category_id": 1,1019 "featured_link": null,1020 "has_accepted_answer": true,1021 "posters": [1022 {1023 "extras": null,1024 "description": "Original Poster",1025 "user": {1026 "id": 82407,1027 "username": "liao_zhang",1028 "name": "liao zhang",1029 "avatar_template": "/user_avatar/discuss.pytorch.org/liao_zhang/{size}/75390_2.png",1030 "trust_level": 11031 }1032 },1033 {1034 "extras": "latest",1035 "description": "Most Recent Poster, Accepted Answer",1036 "user": {1037 "id": 3534,1038 "username": "ptrblck",1039 "name": "",1040 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1041 "admin": true,1042 "moderator": true,1043 "trust_level": 21044 }1045 }1046 ]1047 }1048 ],1049 "tags_descriptions": {},1050 "fancy_title": "Multi classification activation function for last layer",1051 "id": 112445,1052 "title": "Multi classification activation function for last layer",1053 "posts_count": 6,1054 "created_at": "2021-02-20T16:17:18.356Z",1055 "views": 2918,1056 "reply_count": 4,1057 "like_count": 3,1058 "last_posted_at": "2021-02-21T10:53:47.929Z",1059 "visible": true,1060 "closed": false,1061 "archived": false,1062 "has_summary": false,1063 "archetype": "regular",1064 "slug": "multi-classification-activation-function-for-last-layer",1065 "category_id": 1,1066 "word_count": 358,1067 "deleted_at": null,1068 "user_id": 42293,1069 "featured_link": null,1070 "pinned_globally": false,1071 "pinned_at": null,1072 "pinned_until": null,1073 "image_url": null,1074 "slow_mode_seconds": 0,1075 "draft": null,1076 "draft_key": "topic_112445",1077 "draft_sequence": null,1078 "unpinned": null,1079 "pinned": false,1080 "current_post_number": 1,1081 "highest_post_number": 7,1082 "deleted_by": null,1083 "actions_summary": [1084 {1085 "id": 4,1086 "count": 0,1087 "hidden": false,1088 "can_act": false1089 },1090 {1091 "id": 8,1092 "count": 0,1093 "hidden": false,1094 "can_act": false1095 },1096 {1097 "id": 10,1098 "count": 0,1099 "hidden": false,1100 "can_act": false1101 },1102 {1103 "id": 7,1104 "count": 0,1105 "hidden": false,1106 "can_act": false1107 }1108 ],1109 "chunk_size": 20,1110 "bookmarked": false,1111 "topic_timer": null,1112 "message_bus_last_id": 0,1113 "participant_count": 3,1114 "show_read_indicator": false,1115 "thumbnails": null,1116 "slow_mode_enabled_until": null,1117 "accepted_answer": {1118 "post_number": 3,1119 "username": "KFrank",1120 "name": "K. Frank",1121 "excerpt": "Hi Dwight and Mohamed! \nI would like to offer two clarifications: \n\nIf by “predicting values” you mean predicting class labels, this is not \ntrue. To get a predicted class label from the probabilities returned by \nsoftamx() you take argmax(). But softmax() does not change the \norder of the values,…"1122 },1123 "can_vote": false,1124 "vote_count": 0,1125 "user_voted": false,1126 "discourse_zendesk_plugin_zendesk_id": null,1127 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1128 "details": {1129 "can_edit": false,1130 "notification_level": 1,1131 "participants": [1132 {1133 "id": 42293,1134 "username": "Mohamed_Farag",1135 "name": "Mohamed Farag",1136 "avatar_template": "/user_avatar/discuss.pytorch.org/mohamed_farag/{size}/34888_2.png",1137 "post_count": 4,1138 "primary_group_name": null,1139 "flair_name": null,1140 "flair_url": null,1141 "flair_color": null,1142 "flair_bg_color": null,1143 "flair_group_id": null,1144 "trust_level": 11145 },1146 {1147 "id": 18088,1148 "username": "KFrank",1149 "name": "K. Frank",1150 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",1151 "post_count": 1,1152 "primary_group_name": null,1153 "flair_name": null,1154 "flair_url": null,1155 "flair_color": null,1156 "flair_bg_color": null,1157 "flair_group_id": null,1158 "trust_level": 21159 },1160 {1161 "id": 24864,1162 "username": "Dwight_Foster",1163 "name": "Dwight Foster",1164 "avatar_template": "/user_avatar/discuss.pytorch.org/dwight_foster/{size}/18182_2.png",1165 "post_count": 1,1166 "primary_group_name": null,1167 "flair_name": null,1168 "flair_url": null,1169 "flair_color": null,1170 "flair_bg_color": null,1171 "flair_group_id": null,1172 "trust_level": 21173 }1174 ],1175 "created_by": {1176 "id": 42293,1177 "username": "Mohamed_Farag",1178 "name": "Mohamed Farag",1179 "avatar_template": "/user_avatar/discuss.pytorch.org/mohamed_farag/{size}/34888_2.png"1180 },1181 "last_poster": {1182 "id": 42293,1183 "username": "Mohamed_Farag",1184 "name": "Mohamed Farag",1185 "avatar_template": "/user_avatar/discuss.pytorch.org/mohamed_farag/{size}/34888_2.png"1186 }1187 },1188 "bookmarks": []1189 },1190 {1191 "post_stream": {1192 "posts": [1193 {1194 "id": 264844,1195 "name": "maier",1196 "username": "maierf",1197 "avatar_template": "/letter_avatar_proxy/v4/letter/m/ad7895/{size}.png",1198 "created_at": "2021-02-20T20:30:54.699Z",1199 "cooked": "<p>Hey,</p>\n<p>im trying to split ptsemseg’s frrn model to run on 2 GPU’s (Model Parallel) but in doing so i get the following error message.</p>\n<pre><code class=\"lang-auto\">NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/functional.py:2941: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.\n warnings.warn(\"nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.\")\nTraceback (most recent call last):\n File \"/NeuronalNetwork/train/train.py\", line 239, in <module>\n train(cfg, writer, logger)\n File \"/NeuronalNetwork/train/train.py\", line 129, in train\n outputs = model(images.to('cuda:0'))\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/module.py\", line 722, in _call_impl\n result = self.forward(*input, **kwargs)\n File \"/NeuronalNetwork/train/ptsemseg/models/MP_frrn.py\", line 86, in forward\n y, z = getattr(self, key)(y_upsampled, z)\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/module.py\", line 722, in _call_impl\n result = self.forward(*input, **kwargs)\n File \"/NeuronalNetwork/train/ptsemseg/models/utils.py\", line 151, in forward\n y_prime = self.conv1(x)\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/module.py\", line 722, in _call_impl\n result = self.forward(*input, **kwargs)\n File \"/NeuronalNetwork/train/ptsemseg/models/utils.py\", line 75, in forward\n outputs = self.cbr_unit(inputs)\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/module.py\", line 722, in _call_impl\n result = self.forward(*input, **kwargs)\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/container.py\", line 117, in forward\n input = module(input)\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/module.py\", line 722, in _call_impl\n result = self.forward(*input, **kwargs)\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/conv.py\", line 419, in forward\n return self._conv_forward(input, self.weight)\n File \"/NeuronalNetwork/env/lib/python3.6/site-packages/torch/nn/modules/conv.py\", line 416, in _conv_forward\n self.padding, self.dilation, self.groups)\nRuntimeError: Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'; but device 1 does not equal 0 (while checking arguments for cudnn_convolution)\n</code></pre>\n<p>My class (mostly just copied from the existing model with some edit)</p>\n<pre><code class=\"lang-auto\">import torch\n\nimport torch.nn as nn\n\nfrom ptsemseg.models.frrn import frrn\n\nimport torch.nn.functional as F\n\nclass ModelParallelfrrn(frrn):\n\n def __init__(self, *args, **kwargs):\n\n super(ModelParallelfrrn, self).__init__(\n\n n_classes=21, model_type=\"B\", group_norm=False, n_groups=16) # default init values\n\n self.conv1.to(\"cuda:0\")\n\n self.up_residual_units.to(\"cuda:0\")\n\n self.split_conv.to(\"cuda:0\")\n\n self.merge_conv.to(\"cuda:1\")\n\n self.down_residual_units.to(\"cuda:1\")\n\n self.classif_conv.to(\"cuda:1\")\n\n def forward(self, x):\n\n # pass to initial conv\n\n x = self.conv1(x.to(\"cuda:0\"))\n\n # pass through residual units\n\n for i in range(3):\n\n x = self.up_residual_units[i](x)\n\n # divide stream\n\n y = x # full image resolution stream\n\n z = self.split_conv(x) # processed image stream\n\n prev_channels = 48\n\n # encoding\n\n for n_blocks, channels, scale in self.encoder_frru_specs:\n\n # maxpool bigger feature map\n\n y_pooled = F.max_pool2d(y, stride=2, kernel_size=2, padding=0)\n\n # pass through encoding FRRUs\n\n for block in range(n_blocks):\n\n key = \"_\".join(map(str, [\"encoding_frru\", n_blocks, channels, scale, block]))\n\n y, z = getattr(self, key)(y_pooled, z)\n\n prev_channels = channels\n\n # move both streams to GPU 1\n\n y = y.to(\"cuda:1\")\n\n z = z.to(\"cuda:1\")\n\n \n\n # decoding\n\n for n_blocks, channels, scale in self.decoder_frru_specs:\n\n # bilinear upsample smaller feature map\n\n upsample_size = torch.Size([_s * 2 for _s in y.size()[-2:]])\n\n y_upsampled = F.upsample(y, size=upsample_size, mode=\"bilinear\", align_corners=True).to(\"cuda:1\")\n\n # pass through decoding FRRUs\n\n for block in range(n_blocks):\n\n key = \"_\".join(map(str, [\"decoding_frru\", n_blocks, channels, scale, block]))\n\n # print(\"Incoming FRRU Size: \", key, y_upsampled.shape, z.shape)\n\n y, z = getattr(self, key)(y_upsampled, z)\n\n # print(\"Outgoing FRRU Size: \", key, y.shape, z.shape)\n\n prev_channels = channels\n\n # merge streams\n\n x = torch.cat(\n\n [F.upsample(y, scale_factor=2, mode=\"bilinear\", align_corners=True), z], dim=1\n\n ).to(\"cuda:1\")\n\n x = self.merge_conv(x)\n\n # pass through residual units\n\n for i in range(3):\n\n x = self.down_residual_units[i](x)\n\n # final 1x1 conv to get classification\n\n x = self.classif_conv(x)\n\n return x\n</code></pre>\n<p>my model is on GPU 0</p>\n<pre><code> > model.train()\n</code></pre>\n<blockquote>\n<pre><code> labels = labels.to('cuda:0')\n\n # forward pass\n optimizer.zero_grad()\n outputs = model(images.to('cuda:0'))\n\n # backward pass\n labels = labels.to(outputs.device)\n \n loss = loss_fn(input=outputs, target=labels)\n</code></pre>\n</blockquote>\n<p>Does anyone have an idea what the problem might be?</p>",1200 "post_number": 1,