Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 109969,7 "name": "Alexander V.",8 "username": "starphoenix",9 "avatar_template": "/user_avatar/discuss.pytorch.org/starphoenix/{size}/11585_2.png",10 "created_at": "2019-05-06T23:56:21.690Z",11 "cooked": "<p>I am trying to setup distributed training and encountered some problems with initialization of process group.<br>\nSince I have a shared file-system between nodes, I chose initialization with <code>file://</code>. But I got this error:</p>\n<blockquote>\n<p>ValueError: Error initializing torch.distributed using file:// rendezvous: rank parameter missing</p>\n</blockquote>\n<p>Then I found in documentation, that “automatic rank assignment is not supported anymore”, although documentation for <a href=\"https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group\" rel=\"noopener nofollow ugc\">init_process_group</a> imply otherwise.</p>\n<p>Is there a way to not tell <code>init_process_group</code> rank explicitly. And what is the point of <code>init_process_group</code> if I have to pass rank explicitly.</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 2,15 "updated_at": "2019-05-06T23:56:21.690Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 144,20 "reads": 11,21 "readers_count": 10,22 "score": 722.2,23 "yours": false,24 "topic_id": 44554,25 "topic_slug": "automatic-rank-assignment-in-init-process-group",26 "display_username": "Alexander V.",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 "link_counts": [41 {42 "url": "https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group",43 "internal": false,44 "reflection": false,45 "title": "Distributed communication package - torch.distributed — PyTorch master documentation",46 "clicks": 1247 }48 ],49 "read": true,50 "user_title": null,51 "bookmarked": false,52 "actions_summary": [],53 "moderator": false,54 "admin": false,55 "staff": false,56 "user_id": 18185,57 "hidden": false,58 "trust_level": 1,59 "deleted_at": null,60 "user_deleted": false,61 "edit_reason": null,62 "can_view_edit_history": true,63 "wiki": false,64 "post_url": "/t/automatic-rank-assignment-in-init-process-group/44554/1",65 "can_accept_answer": false,66 "can_unaccept_answer": false,67 "accepted_answer": false,68 "topic_accepted_answer": null,69 "can_vote": false70 },71 {72 "id": 119076,73 "name": "Pieter Noordhuis",74 "username": "pietern",75 "avatar_template": "/user_avatar/discuss.pytorch.org/pietern/{size}/4981_2.png",76 "created_at": "2019-06-24T09:27:24.611Z",77 "cooked": "<p>Good point.</p>\n<p>This used to be possible and was not reinstated when we moved to c10d for PyTorch 1.0. I created an issue on GitHub to bring this functionality back: <a href=\"https://github.com/pytorch/pytorch/issues/22128\" rel=\"nofollow noopener\">https://github.com/pytorch/pytorch/issues/22128</a>.</p>",78 "post_number": 2,79 "post_type": 1,80 "posts_count": 2,81 "updated_at": "2019-06-24T09:27:31.952Z",82 "reply_count": 0,83 "reply_to_post_number": null,84 "quote_count": 0,85 "incoming_link_count": 8,86 "reads": 9,87 "readers_count": 8,88 "score": 41.8,89 "yours": false,90 "topic_id": 44554,91 "topic_slug": "automatic-rank-assignment-in-init-process-group",92 "display_username": "Pieter Noordhuis",93 "primary_group_name": null,94 "flair_name": null,95 "flair_url": null,96 "flair_bg_color": null,97 "flair_color": null,98 "flair_group_id": null,99 "badges_granted": [],100 "version": 1,101 "can_edit": false,102 "can_delete": false,103 "can_recover": false,104 "can_see_hidden_post": false,105 "can_wiki": false,106 "link_counts": [107 {108 "url": "https://github.com/pytorch/pytorch/issues/22128",109 "internal": false,110 "reflection": false,111 "title": "Automatic rank selection when using file:// initialization method · Issue #22128 · pytorch/pytorch · GitHub",112 "clicks": 30113 }114 ],115 "read": true,116 "user_title": null,117 "bookmarked": false,118 "actions_summary": [],119 "moderator": false,120 "admin": false,121 "staff": false,122 "user_id": 8832,123 "hidden": false,124 "trust_level": 2,125 "deleted_at": null,126 "user_deleted": false,127 "edit_reason": null,128 "can_view_edit_history": true,129 "wiki": false,130 "post_url": "/t/automatic-rank-assignment-in-init-process-group/44554/2",131 "can_accept_answer": false,132 "can_unaccept_answer": false,133 "accepted_answer": false,134 "topic_accepted_answer": null135 }136 ],137 "stream": [138 109969,139 119076140 ]141 },142 "timeline_lookup": [143 [144 1,145 2364146 ],147 [148 2,149 2316150 ]151 ],152 "suggested_topics": [153 {154 "fancy_title": "Torch.distributed.all_reduce causes memory trashing",155 "id": 215024,156 "title": "Torch.distributed.all_reduce causes memory trashing",157 "slug": "torch-distributed-all-reduce-causes-memory-trashing",158 "posts_count": 3,159 "reply_count": 1,160 "highest_post_number": 3,161 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/5/8/5838d755d5ca5296ddc8137c78a5014be93befef_2_1024x422.jpeg",162 "created_at": "2025-01-06T12:06:07.456Z",163 "last_posted_at": "2025-01-06T17:20:12.781Z",164 "bumped": true,165 "bumped_at": "2025-01-06T17:20:12.781Z",166 "archetype": "regular",167 "unseen": false,168 "pinned": false,169 "unpinned": null,170 "visible": true,171 "closed": false,172 "archived": false,173 "bookmarked": null,174 "liked": null,175 "tags_descriptions": {},176 "like_count": 1,177 "views": 105,178 "category_id": 12,179 "featured_link": null,180 "has_accepted_answer": true,181 "posters": [182 {183 "extras": null,184 "description": "Original Poster, Accepted Answer",185 "user": {186 "id": 81545,187 "username": "SzymonOzog",188 "name": "Szymon Ożóg",189 "avatar_template": "/user_avatar/discuss.pytorch.org/szymonozog/{size}/74552_2.png",190 "trust_level": 1191 }192 },193 {194 "extras": "latest",195 "description": "Most Recent Poster",196 "user": {197 "id": 49515,198 "username": "agu",199 "name": "Andrew Gu",200 "avatar_template": "/user_avatar/discuss.pytorch.org/agu/{size}/49913_2.png",201 "trust_level": 2202 }203 }204 ]205 },206 {207 "fancy_title": "DDP training get slower than first few iteration",208 "id": 212204,209 "title": "DDP training get slower than first few iteration",210 "slug": "ddp-training-get-slower-than-first-few-iteration",211 "posts_count": 3,212 "reply_count": 1,213 "highest_post_number": 3,214 "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/e/9/e96971f81fe3add1a25239274255bf7d36886808.png",215 "created_at": "2024-10-28T11:27:39.122Z",216 "last_posted_at": "2024-11-01T05:47:29.441Z",217 "bumped": true,218 "bumped_at": "2024-11-01T05:47:29.441Z",219 "archetype": "regular",220 "unseen": false,221 "pinned": false,222 "unpinned": null,223 "visible": true,224 "closed": false,225 "archived": false,226 "bookmarked": null,227 "liked": null,228 "tags_descriptions": {},229 "like_count": 0,230 "views": 277,231 "category_id": 12,232 "featured_link": null,233 "has_accepted_answer": false,234 "posters": [235 {236 "extras": "latest",237 "description": "Original Poster, Most Recent Poster",238 "user": {239 "id": 80536,240 "username": "GEOLU",241 "name": "",242 "avatar_template": "/user_avatar/discuss.pytorch.org/geolu/{size}/73621_2.png",243 "trust_level": 1244 }245 },246 {247 "extras": null,248 "description": "Frequent Poster",249 "user": {250 "id": 3534,251 "username": "ptrblck",252 "name": "",253 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",254 "admin": true,255 "moderator": true,256 "trust_level": 2257 }258 }259 ]260 },261 {262 "fancy_title": "Behavior of wait() on async CUDA collectives",263 "id": 214543,264 "title": "Behavior of wait() on async CUDA collectives",265 "slug": "behavior-of-wait-on-async-cuda-collectives",266 "posts_count": 2,267 "reply_count": 0,268 "highest_post_number": 2,269 "image_url": null,270 "created_at": "2024-12-22T15:28:02.279Z",271 "last_posted_at": "2024-12-26T22:56:53.306Z",272 "bumped": true,273 "bumped_at": "2024-12-26T22:56:53.306Z",274 "archetype": "regular",275 "unseen": false,276 "pinned": false,277 "unpinned": null,278 "visible": true,279 "closed": false,280 "archived": false,281 "bookmarked": null,282 "liked": null,283 "tags_descriptions": {},284 "like_count": 0,285 "views": 169,286 "category_id": 12,287 "featured_link": null,288 "has_accepted_answer": false,289 "posters": [290 {291 "extras": null,292 "description": "Original Poster",293 "user": {294 "id": 80214,295 "username": "x41lakazam",296 "name": "",297 "avatar_template": "/user_avatar/discuss.pytorch.org/x41lakazam/{size}/73332_2.png",298 "trust_level": 1299 }300 },301 {302 "extras": "latest",303 "description": "Most Recent Poster",304 "user": {305 "id": 39542,306 "username": "H-Huang",307 "name": "Howard Huang",308 "avatar_template": "/user_avatar/discuss.pytorch.org/h-huang/{size}/35598_2.png",309 "trust_level": 2310 }311 }312 ]313 },314 {315 "fancy_title": "How Adam optimizer works while using Pipeline Parallelism?",316 "id": 212361,317 "title": "How Adam optimizer works while using Pipeline Parallelism?",318 "slug": "how-adam-optimizer-works-while-using-pipeline-parallelism",319 "posts_count": 1,320 "reply_count": 0,321 "highest_post_number": 1,322 "image_url": null,323 "created_at": "2024-10-31T09:25:47.200Z",324 "last_posted_at": "2024-10-31T09:25:47.242Z",325 "bumped": true,326 "bumped_at": "2024-10-31T09:25:47.242Z",327 "archetype": "regular",328 "unseen": false,329 "pinned": false,330 "unpinned": null,331 "visible": true,332 "closed": false,333 "archived": false,334 "bookmarked": null,335 "liked": null,336 "tags_descriptions": {},337 "like_count": 0,338 "views": 175,339 "category_id": 12,340 "featured_link": null,341 "has_accepted_answer": false,342 "posters": [343 {344 "extras": "latest single",345 "description": "Original Poster, Most Recent Poster",346 "user": {347 "id": 80613,348 "username": "Aerithy",349 "name": "Yuntong Lee",350 "avatar_template": "/user_avatar/discuss.pytorch.org/aerithy/{size}/73699_2.png",351 "trust_level": 0352 }353 }354 ]355 },356 {357 "fancy_title": "FSDP2 issue with layer sharding",358 "id": 215820,359 "title": "FSDP2 issue with layer sharding",360 "slug": "fsdp2-issue-with-layer-sharding",361 "posts_count": 2,362 "reply_count": 0,363 "highest_post_number": 2,364 "image_url": null,365 "created_at": "2025-01-24T12:02:19.267Z",366 "last_posted_at": "2025-01-24T16:54:42.350Z",367 "bumped": true,368 "bumped_at": "2025-01-24T18:07:39.302Z",369 "archetype": "regular",370 "unseen": false,371 "pinned": false,372 "unpinned": null,373 "visible": true,374 "closed": false,375 "archived": false,376 "bookmarked": null,377 "liked": null,378 "tags_descriptions": {},379 "like_count": 0,380 "views": 208,381 "category_id": 12,382 "featured_link": null,383 "has_accepted_answer": true,384 "posters": [385 {386 "extras": "latest single",387 "description": "Original Poster, Most Recent Poster, Accepted Answer",388 "user": {389 "id": 21800,390 "username": "Philipp_Singer",391 "name": "Philipp Singer",392 "avatar_template": "/user_avatar/discuss.pytorch.org/philipp_singer/{size}/15250_2.png",393 "trust_level": 1394 }395 }396 ]397 }398 ],399 "tags_descriptions": {},400 "fancy_title": "Automatic rank assignment in init_process_group",401 "id": 44554,402 "title": "Automatic rank assignment in init_process_group",403 "posts_count": 2,404 "created_at": "2019-05-06T23:56:21.644Z",405 "views": 594,406 "reply_count": 0,407 "like_count": 0,408 "last_posted_at": "2019-06-24T09:27:24.611Z",409 "visible": true,410 "closed": false,411 "archived": false,412 "has_summary": false,413 "archetype": "regular",414 "slug": "automatic-rank-assignment-in-init-process-group",415 "category_id": 12,416 "word_count": 137,417 "deleted_at": null,418 "user_id": 18185,419 "featured_link": null,420 "pinned_globally": false,421 "pinned_at": null,422 "pinned_until": null,423 "image_url": null,424 "slow_mode_seconds": 0,425 "draft": null,426 "draft_key": "topic_44554",427 "draft_sequence": null,428 "unpinned": null,429 "pinned": false,430 "current_post_number": 1,431 "highest_post_number": 2,432 "deleted_by": null,433 "actions_summary": [434 {435 "id": 4,436 "count": 0,437 "hidden": false,438 "can_act": false439 },440 {441 "id": 8,442 "count": 0,443 "hidden": false,444 "can_act": false445 },446 {447 "id": 10,448 "count": 0,449 "hidden": false,450 "can_act": false451 },452 {453 "id": 7,454 "count": 0,455 "hidden": false,456 "can_act": false457 }458 ],459 "chunk_size": 20,460 "bookmarked": false,461 "topic_timer": null,462 "message_bus_last_id": 0,463 "participant_count": 2,464 "show_read_indicator": false,465 "thumbnails": null,466 "slow_mode_enabled_until": null,467 "can_vote": false,468 "vote_count": 0,469 "user_voted": false,470 "discourse_zendesk_plugin_zendesk_id": null,471 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",472 "details": {473 "can_edit": false,474 "notification_level": 1,475 "participants": [476 {477 "id": 8832,478 "username": "pietern",479 "name": "Pieter Noordhuis",480 "avatar_template": "/user_avatar/discuss.pytorch.org/pietern/{size}/4981_2.png",481 "post_count": 1,482 "primary_group_name": null,483 "flair_name": null,484 "flair_url": null,485 "flair_color": null,486 "flair_bg_color": null,487 "flair_group_id": null,488 "trust_level": 2489 },490 {491 "id": 18185,492 "username": "starphoenix",493 "name": "Alexander V.",494 "avatar_template": "/user_avatar/discuss.pytorch.org/starphoenix/{size}/11585_2.png",495 "post_count": 1,496 "primary_group_name": null,497 "flair_name": null,498 "flair_url": null,499 "flair_color": null,500 "flair_bg_color": null,501 "flair_group_id": null,502 "trust_level": 1503 }504 ],505 "created_by": {506 "id": 18185,507 "username": "starphoenix",508 "name": "Alexander V.",509 "avatar_template": "/user_avatar/discuss.pytorch.org/starphoenix/{size}/11585_2.png"510 },511 "last_poster": {512 "id": 8832,513 "username": "pietern",514 "name": "Pieter Noordhuis",515 "avatar_template": "/user_avatar/discuss.pytorch.org/pietern/{size}/4981_2.png"516 },517 "links": [518 {519 "url": "https://github.com/pytorch/pytorch/issues/22128",520 "title": "Automatic rank selection when using file:// initialization method · Issue #22128 · pytorch/pytorch · GitHub",521 "internal": false,522 "attachment": false,523 "reflection": false,524 "clicks": 30,525 "user_id": 8832,526 "domain": "github.com",527 "root_domain": "github.com"528 },529 {530 "url": "https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group",531 "title": "Distributed communication package - torch.distributed — PyTorch master documentation",532 "internal": false,533 "attachment": false,534 "reflection": false,535 "clicks": 12,536 "user_id": 18185,537 "domain": "pytorch.org",538 "root_domain": "pytorch.org"539 }540 ]541 },542 "bookmarks": []543 },544 {545 "post_stream": {546 "posts": [547 {548 "id": 118924,549 "name": "lidaryani",550 "username": "lidaryani",551 "avatar_template": "/letter_avatar_proxy/v4/letter/l/a5b964/{size}.png",552 "created_at": "2019-06-23T15:20:48.275Z",553 "cooked": "<p>Hello<br>\nI want to implement the U-net with Pytorch but I have several questions.<br>\nThe first question is: The input of U-net is a slice of the abdominal CT scan and The organs must be segmented at the output, should I set the number of U-net output classes to the number of organs?<br>\nevery slice has a size like 1x512x512</p>\n<p>I set U-net input size to one, and output size(number of classes) to number of organs. I mean, is it right?</p>\n<p>Second question: how many dimensional should Grand truth be? Suppose we have 10 classes(10 organs). Should I create a tensor, which, in every dimension, is one of the organs maintained by Grand truth(10x512x512)? Or do I create a tensor with one dimension and identify each organ with an independent value(1x512x512)?</p>",554 "post_number": 1,555 "post_type": 1,556 "posts_count": 5,557 "updated_at": "2019-06-23T15:22:50.834Z",558 "reply_count": 0,559 "reply_to_post_number": null,560 "quote_count": 0,561 "incoming_link_count": 44,562 "reads": 31,563 "readers_count": 30,564 "score": 226.2,565 "yours": false,566 "topic_id": 48758,567 "topic_slug": "problems-in-implementing-of-u-net",568 "display_username": "lidaryani",569 "primary_group_name": null,570 "flair_name": null,571 "flair_url": null,572 "flair_bg_color": null,573 "flair_color": null,574 "flair_group_id": null,575 "badges_granted": [],576 "version": 1,577 "can_edit": false,578 "can_delete": false,579 "can_recover": false,580 "can_see_hidden_post": false,581 "can_wiki": false,582 "read": true,583 "user_title": null,584 "bookmarked": false,585 "actions_summary": [],586 "moderator": false,587 "admin": false,588 "staff": false,589 "user_id": 12641,590 "hidden": false,591 "trust_level": 1,592 "deleted_at": null,593 "user_deleted": false,594 "edit_reason": null,595 "can_view_edit_history": true,596 "wiki": false,597 "post_url": "/t/problems-in-implementing-of-u-net/48758/1",598 "can_accept_answer": false,599 "can_unaccept_answer": false,600 "accepted_answer": false,601 "topic_accepted_answer": null,602 "can_vote": false603 },604 {605 "id": 118937,606 "name": "",607 "username": "ptrblck",608 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",609 "created_at": "2019-06-23T16:02:32.742Z",610 "cooked": "<p>If you are using <code>nn.CrossEntropyLoss</code> or <code>nn.NLLLoss</code> as your criterion, the output of your model should have the shape <code>[batch_size, nb_classes, height, width]</code>, while your target should be a <code>LongTensor</code> in the shape <code>[batch_size, height, width]</code> containing the class indices.<br>\nIf you are not dealing with a background class, the number of classes should correspond to the number of organs.</p>",611 "post_number": 2,612 "post_type": 1,613 "posts_count": 5,614 "updated_at": "2019-06-23T16:02:32.742Z",615 "reply_count": 1,616 "reply_to_post_number": null,617 "quote_count": 0,618 "incoming_link_count": 0,619 "reads": 29,620 "readers_count": 28,621 "score": 25.8,622 "yours": false,623 "topic_id": 48758,624 "topic_slug": "problems-in-implementing-of-u-net",625 "display_username": "",626 "primary_group_name": null,627 "flair_name": null,628 "flair_url": null,629 "flair_bg_color": null,630 "flair_color": null,631 "flair_group_id": null,632 "badges_granted": [],633 "version": 1,634 "can_edit": false,635 "can_delete": false,636 "can_recover": false,637 "can_see_hidden_post": false,638 "can_wiki": false,639 "read": true,640 "user_title": "",641 "bookmarked": false,642 "actions_summary": [643 {644 "id": 2,645 "count": 1646 }647 ],648 "moderator": true,649 "admin": true,650 "staff": true,651 "user_id": 3534,652 "hidden": false,653 "trust_level": 2,654 "deleted_at": null,655 "user_deleted": false,656 "edit_reason": null,657 "can_view_edit_history": true,658 "wiki": false,659 "post_url": "/t/problems-in-implementing-of-u-net/48758/2",660 "can_accept_answer": false,661 "can_unaccept_answer": false,662 "accepted_answer": false,663 "topic_accepted_answer": null664 },665 {666 "id": 118941,667 "name": "lidaryani",668 "username": "lidaryani",669 "avatar_template": "/letter_avatar_proxy/v4/letter/l/a5b964/{size}.png",670 "created_at": "2019-06-23T16:22:45.567Z",671 "cooked": "<p>Thank you so much for replying, and another question came to me that is: if I change criterion from <code>nn.CrossEntropyLoss</code> to Dice( or other criterion functions) the shape of the target is important?<br>\nNow I am using <code>nn.CrossEntropyLoss</code> but the output after 500 epochs is not satisfied me and it’s not like the output of papers with same situations, so I thought maybe my code is wrong, so I doubted the size of the target and model. So the size of the Target and the model can cause the problem of not learning?</p>",672 "post_number": 3,673 "post_type": 1,674 "posts_count": 5,675 "updated_at": "2019-06-23T16:33:33.343Z",676 "reply_count": 1,677 "reply_to_post_number": 2,678 "quote_count": 0,679 "incoming_link_count": 3,680 "reads": 29,681 "readers_count": 28,682 "score": 25.8,683 "yours": false,684 "topic_id": 48758,685 "topic_slug": "problems-in-implementing-of-u-net",686 "display_username": "lidaryani",687 "primary_group_name": null,688 "flair_name": null,689 "flair_url": null,690 "flair_bg_color": null,691 "flair_color": null,692 "flair_group_id": null,693 "badges_granted": [],694 "version": 2,695 "can_edit": false,696 "can_delete": false,697 "can_recover": false,698 "can_see_hidden_post": false,699 "can_wiki": false,700 "read": true,701 "user_title": null,702 "reply_to_user": {703 "id": 3534,704 "username": "ptrblck",705 "name": "",706 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"707 },708 "bookmarked": false,709 "actions_summary": [],710 "moderator": false,711 "admin": false,712 "staff": false,713 "user_id": 12641,714 "hidden": false,715 "trust_level": 1,716 "deleted_at": null,717 "user_deleted": false,718 "edit_reason": null,719 "can_view_edit_history": true,720 "wiki": false,721 "post_url": "/t/problems-in-implementing-of-u-net/48758/3",722 "can_accept_answer": false,723 "can_unaccept_answer": false,724 "accepted_answer": false,725 "topic_accepted_answer": null726 },727 {728 "id": 118943,729 "name": "",730 "username": "ptrblck",731 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",732 "created_at": "2019-06-23T16:54:18.033Z",733 "cooked": "<aside class=\"quote no-group\" data-username=\"lidaryani\" data-post=\"3\" data-topic=\"48758\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/l/a5b964/48.png\" class=\"avatar\"> lidaryani:</div>\n<blockquote>\n<p>so I doubted the size of the target and model.</p>\n</blockquote>\n</aside>\n<p>Which size did you double? The spatial size or the number of channels?</p>\n<p>If you are using another loss function, e.g. dice loss, you have to make sure to pass the output and target in a specific shape. Have a look at <a href=\"https://github.com/pytorch/pytorch/issues/1249#issuecomment-339904369\">this post</a> to see an implementation of multi-class dice loss.</p>",734 "post_number": 4,735 "post_type": 1,736 "posts_count": 5,737 "updated_at": "2019-06-23T16:54:18.033Z",738 "reply_count": 1,739 "reply_to_post_number": 3,740 "quote_count": 1,741 "incoming_link_count": 1,742 "reads": 26,743 "readers_count": 25,744 "score": 30.2,745 "yours": false,746 "topic_id": 48758,747 "topic_slug": "problems-in-implementing-of-u-net",748 "display_username": "",749 "primary_group_name": null,750 "flair_name": null,751 "flair_url": null,752 "flair_bg_color": null,753 "flair_color": null,754 "flair_group_id": null,755 "badges_granted": [],756 "version": 1,757 "can_edit": false,758 "can_delete": false,759 "can_recover": false,760 "can_see_hidden_post": false,761 "can_wiki": false,762 "link_counts": [763 {764 "url": "https://github.com/pytorch/pytorch/issues/1249#issuecomment-339904369",765 "internal": false,766 "reflection": false,767 "title": "Dice Loss PR · Issue #1249 · pytorch/pytorch · GitHub",768 "clicks": 14769 }770 ],771 "read": true,772 "user_title": "",773 "bookmarked": false,774 "actions_summary": [775 {776 "id": 2,777 "count": 1778 }779 ],780 "moderator": true,781 "admin": true,782 "staff": true,783 "user_id": 3534,784 "hidden": false,785 "trust_level": 2,786 "deleted_at": null,787 "user_deleted": false,788 "edit_reason": null,789 "can_view_edit_history": true,790 "wiki": false,791 "post_url": "/t/problems-in-implementing-of-u-net/48758/4",792 "can_accept_answer": false,793 "can_unaccept_answer": false,794 "accepted_answer": false,795 "topic_accepted_answer": null796 },797 {798 "id": 119075,799 "name": "lidaryani",800 "username": "lidaryani",801 "avatar_template": "/letter_avatar_proxy/v4/letter/l/a5b964/{size}.png",802 "created_at": "2019-06-24T09:24:59.811Z",803 "cooked": "<p>The post you mentioned me solved my problem.Thank you.</p>",804 "post_number": 5,805 "post_type": 1,806 "posts_count": 5,807 "updated_at": "2019-06-24T09:24:59.811Z",808 "reply_count": 0,809 "reply_to_post_number": 4,810 "quote_count": 0,811 "incoming_link_count": 1,812 "reads": 21,813 "readers_count": 20,814 "score": 9.2,815 "yours": false,816 "topic_id": 48758,817 "topic_slug": "problems-in-implementing-of-u-net",818 "display_username": "lidaryani",819 "primary_group_name": null,820 "flair_name": null,821 "flair_url": null,822 "flair_bg_color": null,823 "flair_color": null,824 "flair_group_id": null,825 "badges_granted": [],826 "version": 1,827 "can_edit": false,828 "can_delete": false,829 "can_recover": false,830 "can_see_hidden_post": false,831 "can_wiki": false,832 "read": true,833 "user_title": null,834 "reply_to_user": {835 "id": 3534,836 "username": "ptrblck",837 "name": "",838 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"839 },840 "bookmarked": false,841 "actions_summary": [],842 "moderator": false,843 "admin": false,844 "staff": false,845 "user_id": 12641,846 "hidden": false,847 "trust_level": 1,848 "deleted_at": null,849 "user_deleted": false,850 "edit_reason": null,851 "can_view_edit_history": true,852 "wiki": false,853 "post_url": "/t/problems-in-implementing-of-u-net/48758/5",854 "can_accept_answer": false,855 "can_unaccept_answer": false,856 "accepted_answer": false,857 "topic_accepted_answer": null858 }859 ],860 "stream": [861 118924,862 118937,863 118941,864 118943,865 119075866 ]867 },868 "timeline_lookup": [869 [870 1,871 2316872 ]873 ],874 "suggested_topics": [875 {876 "fancy_title": "NVIDIA L40S-48Q and “RuntimeError: CUDA error: operation not supported”",877 "id": 212716,878 "title": "NVIDIA L40S-48Q and \"RuntimeError: CUDA error: operation not supported\"",879 "slug": "nvidia-l40s-48q-and-runtimeerror-cuda-error-operation-not-supported",880 "posts_count": 11,881 "reply_count": 9,882 "highest_post_number": 11,883 "image_url": null,884 "created_at": "2024-11-08T19:29:41.292Z",885 "last_posted_at": "2025-02-11T14:25:17.459Z",886 "bumped": true,887 "bumped_at": "2025-02-11T14:26:35.274Z",888 "archetype": "regular",889 "unseen": false,890 "pinned": false,891 "unpinned": null,892 "visible": true,893 "closed": false,894 "archived": false,895 "bookmarked": null,896 "liked": null,897 "tags_descriptions": {},898 "like_count": 1,899 "views": 1360,900 "category_id": 1,901 "featured_link": null,902 "has_accepted_answer": false,903 "posters": [904 {905 "extras": null,906 "description": "Original Poster",907 "user": {908 "id": 7291,909 "username": "Chris_Palmer",910 "name": "Chris Palmer",911 "avatar_template": "/user_avatar/discuss.pytorch.org/chris_palmer/{size}/12322_2.png",912 "trust_level": 1913 }914 },915 {916 "extras": null,917 "description": "Frequent Poster",918 "user": {919 "id": 3534,920 "username": "ptrblck",921 "name": "",922 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",923 "admin": true,924 "moderator": true,925 "trust_level": 2926 }927 },928 {929 "extras": "latest",930 "description": "Most Recent Poster",931 "user": {932 "id": 82625,933 "username": "briskajanis1",934 "name": "Briskajanis1",935 "avatar_template": "/user_avatar/discuss.pytorch.org/briskajanis1/{size}/75599_2.png",936 "trust_level": 0937 }938 }939 ]940 },941 {942 "fancy_title": "Runtime error: “ImportError: /usr/lib64/libtorch_cuda.so: undefined symbol: cudnnSetDropoutDescriptor”",943 "id": 212671,944 "title": "Runtime error: \"ImportError: /usr/lib64/libtorch_cuda.so: undefined symbol: cudnnSetDropoutDescriptor\"",945 "slug": "runtime-error-importerror-usr-lib64-libtorch-cuda-so-undefined-symbol-cudnnsetdropoutdescriptor",946 "posts_count": 9,947 "reply_count": 6,948 "highest_post_number": 9,949 "image_url": null,950 "created_at": "2024-11-07T23:33:42.975Z",951 "last_posted_at": "2024-11-09T22:38:42.148Z",952 "bumped": true,953 "bumped_at": "2024-11-09T22:38:42.148Z",954 "archetype": "regular",955 "unseen": false,956 "pinned": false,957 "unpinned": null,958 "visible": true,959 "closed": false,960 "archived": false,961 "bookmarked": null,962 "liked": null,963 "tags_descriptions": {},964 "like_count": 0,965 "views": 2102,966 "category_id": 1,967 "featured_link": null,968 "has_accepted_answer": true,969 "posters": [970 {971 "extras": "latest",972 "description": "Original Poster, Most Recent Poster, Accepted Answer",973 "user": {974 "id": 75981,975 "username": "Geremia",976 "name": "Geremia",977 "avatar_template": "/user_avatar/discuss.pytorch.org/geremia/{size}/70165_2.png",978 "trust_level": 2979 }980 },981 {982 "extras": null,983 "description": "Frequent Poster",984 "user": {985 "id": 3534,986 "username": "ptrblck",987 "name": "",988 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",989 "admin": true,990 "moderator": true,991 "trust_level": 2992 }993 }994 ]995 },996 {997 "fancy_title": "ImportError : cannot import name ‘DiagnosticOptions’ from ‘torch.onnx._internal.exporter’",998 "id": 215989,999 "title": "ImportError : cannot import name ‘DiagnosticOptions’ from ‘torch.onnx._internal.exporter’",1000 "slug": "importerror-cannot-import-name-diagnosticoptions-from-torch-onnx-internal-exporter",1001 "posts_count": 2,1002 "reply_count": 0,1003 "highest_post_number": 2,1004 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/a/3/a3a542821235a5d5307f1577a9ede9d33da98334_2_1024x282.png",1005 "created_at": "2025-01-28T13:17:41.487Z",1006 "last_posted_at": "2025-02-10T06:40:11.050Z",1007 "bumped": true,1008 "bumped_at": "2025-02-10T06:40:11.050Z",1009 "archetype": "regular",1010 "unseen": false,1011 "pinned": false,1012 "unpinned": null,1013 "visible": true,1014 "closed": false,1015 "archived": false,1016 "bookmarked": null,1017 "liked": null,1018 "tags_descriptions": {},1019 "like_count": 0,1020 "views": 1679,1021 "category_id": 1,1022 "featured_link": null,1023 "has_accepted_answer": false,1024 "posters": [1025 {1026 "extras": null,1027 "description": "Original Poster",1028 "user": {1029 "id": 82357,1030 "username": "cyy",1031 "name": "adqdqefwe",1032 "avatar_template": "/letter_avatar_proxy/v4/letter/c/e480ec/{size}.png",1033 "trust_level": 01034 }1035 },1036 {1037 "extras": "latest",1038 "description": "Most Recent Poster",1039 "user": {1040 "id": 71955,1041 "username": "ashok_arora",1042 "name": "Ashok Arora",1043 "avatar_template": "/user_avatar/discuss.pytorch.org/ashok_arora/{size}/66772_2.png",1044 "trust_level": 11045 }1046 }1047 ]1048 },1049 {1050 "fancy_title": "Pytorch_geometric Linear layer return different results",1051 "id": 216809,1052 "title": "Pytorch_geometric Linear layer return different results",1053 "slug": "pytorch-geometric-linear-layer-return-different-results",1054 "posts_count": 3,1055 "reply_count": 1,1056 "highest_post_number": 3,1057 "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/e/a/ea1df01cd4284170c6c91d2a995637b0c9d5a371.png",1058 "created_at": "2025-02-18T06:48:57.128Z",1059 "last_posted_at": "2025-04-02T14:06:40.813Z",1060 "bumped": true,1061 "bumped_at": "2025-04-02T14:06:40.813Z",1062 "archetype": "regular",1063 "unseen": false,1064 "pinned": false,1065 "unpinned": null,1066 "visible": true,1067 "closed": false,1068 "archived": false,1069 "bookmarked": null,1070 "liked": null,1071 "tags_descriptions": {},1072 "like_count": 1,1073 "views": 133,1074 "category_id": 1,1075 "featured_link": null,1076 "has_accepted_answer": false,1077 "posters": [1078 {1079 "extras": "latest",1080 "description": "Original Poster, Most Recent Poster",1081 "user": {1082 "id": 82755,1083 "username": "shahar",1084 "name": "shahar",1085 "avatar_template": "/user_avatar/discuss.pytorch.org/shahar/{size}/75714_2.png",1086 "trust_level": 11087 }1088 },1089 {1090 "extras": null,1091 "description": "Frequent Poster",1092 "user": {1093 "id": 3534,1094 "username": "ptrblck",1095 "name": "",1096 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1097 "admin": true,1098 "moderator": true,1099 "trust_level": 21100 }1101 }1102 ]1103 },1104 {1105 "fancy_title": "Large output differences when using torch.no_grad() with TransformerEncoder (FlashAttention?)",1106 "id": 217491,1107 "title": "Large output differences when using torch.no_grad() with TransformerEncoder (FlashAttention?)",1108 "slug": "large-output-differences-when-using-torch-no-grad-with-transformerencoder-flashattention",1109 "posts_count": 1,1110 "reply_count": 0,1111 "highest_post_number": 1,1112 "image_url": null,1113 "created_at": "2025-03-05T21:39:23.351Z",1114 "last_posted_at": "2025-03-05T21:39:23.387Z",1115 "bumped": true,1116 "bumped_at": "2025-03-05T22:53:15.929Z",1117 "archetype": "regular",1118 "unseen": false,1119 "pinned": false,1120 "unpinned": null,1121 "visible": true,1122 "closed": false,1123 "archived": false,1124 "bookmarked": null,1125 "liked": null,1126 "tags_descriptions": {},1127 "like_count": 0,1128 "views": 27,1129 "category_id": 1,1130 "featured_link": null,1131 "has_accepted_answer": false,1132 "posters": [1133 {1134 "extras": "latest single",1135 "description": "Original Poster, Most Recent Poster",1136 "user": {1137 "id": 83092,1138 "username": "ekf",1139 "name": null,1140 "avatar_template": "/user_avatar/discuss.pytorch.org/ekf/{size}/76005_2.png",1141 "trust_level": 11142 }1143 }1144 ]1145 }1146 ],1147 "tags_descriptions": {},1148 "fancy_title": "Problems in implementing of U-net",1149 "id": 48758,1150 "title": "Problems in implementing of U-net",1151 "posts_count": 5,1152 "created_at": "2019-06-23T15:20:48.230Z",1153 "views": 459,1154 "reply_count": 3,1155 "like_count": 2,1156 "last_posted_at": "2019-06-24T09:24:59.811Z",1157 "visible": true,1158 "closed": false,1159 "archived": false,1160 "has_summary": false,1161 "archetype": "regular",1162 "slug": "problems-in-implementing-of-u-net",1163 "category_id": 1,1164 "word_count": 387,1165 "deleted_at": null,1166 "user_id": 12641,1167 "featured_link": null,1168 "pinned_globally": false,1169 "pinned_at": null,1170 "pinned_until": null,1171 "image_url": null,1172 "slow_mode_seconds": 0,1173 "draft": null,1174 "draft_key": "topic_48758",1175 "draft_sequence": null,1176 "unpinned": null,1177 "pinned": false,1178 "current_post_number": 1,1179 "highest_post_number": 5,1180 "deleted_by": null,1181 "actions_summary": [1182 {1183 "id": 4,1184 "count": 0,1185 "hidden": false,1186 "can_act": false1187 },1188 {1189 "id": 8,1190 "count": 0,1191 "hidden": false,1192 "can_act": false1193 },1194 {1195 "id": 10,1196 "count": 0,1197 "hidden": false,1198 "can_act": false1199 },1200 {