Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 439396,7 "name": "Amirul Islam Saimon",8 "username": "Saimon",9 "avatar_template": "/letter_avatar_proxy/v4/letter/s/7cd45c/{size}.png",10 "created_at": "2024-04-15T21:33:29.978Z",11 "cooked": "<p>Hello,</p>\n<p>How can I use scipy.spatial.ConvexHull in my PyTorch model? I need to backpropagate through it.</p>\n<p>Thanks in advance!</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 1,15 "updated_at": "2024-04-15T21:33:29.978Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 19,20 "reads": 6,21 "readers_count": 5,22 "score": 96.2,23 "yours": false,24 "topic_id": 200946,25 "topic_slug": "scipy-package-in-pytorch-model",26 "display_username": "Amirul Islam Saimon",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": 73940,48 "hidden": false,49 "trust_level": 1,50 "deleted_at": null,51 "user_deleted": false,52 "edit_reason": null,53 "can_view_edit_history": true,54 "wiki": false,55 "post_url": "/t/scipy-package-in-pytorch-model/200946/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 43939665 ]66 },67 "timeline_lookup": [68 [69 1,70 55871 ]72 ],73 "suggested_topics": [74 {75 "fancy_title": "Running Pytorch 1.13 on H100",76 "id": 212333,77 "title": "Running Pytorch 1.13 on H100",78 "slug": "running-pytorch-1-13-on-h100",79 "posts_count": 6,80 "reply_count": 4,81 "highest_post_number": 6,82 "image_url": null,83 "created_at": "2024-10-30T23:18:12.056Z",84 "last_posted_at": "2024-11-16T14:28:04.330Z",85 "bumped": true,86 "bumped_at": "2024-11-16T14:28:04.330Z",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": 577,99 "category_id": 1,100 "featured_link": null,101 "has_accepted_answer": false,102 "posters": [103 {104 "extras": null,105 "description": "Original Poster",106 "user": {107 "id": 2920,108 "username": "Sia_Rezaei",109 "name": "Sia Rezaei",110 "avatar_template": "/user_avatar/discuss.pytorch.org/sia_rezaei/{size}/43436_2.png",111 "trust_level": 2112 }113 },114 {115 "extras": null,116 "description": "Frequent Poster",117 "user": {118 "id": 80949,119 "username": "Yangqi_Long",120 "name": "Yangqi Long",121 "avatar_template": "/user_avatar/discuss.pytorch.org/yangqi_long/{size}/74032_2.png",122 "trust_level": 0123 }124 },125 {126 "extras": "latest",127 "description": "Most Recent Poster",128 "user": {129 "id": 3534,130 "username": "ptrblck",131 "name": "",132 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",133 "admin": true,134 "moderator": true,135 "trust_level": 2136 }137 }138 ]139 },140 {141 "fancy_title": "Which activation function for multi-class classification gives true probability?",142 "id": 213065,143 "title": "Which activation function for multi-class classification gives true probability?",144 "slug": "which-activation-function-for-multi-class-classification-gives-true-probability",145 "posts_count": 2,146 "reply_count": 0,147 "highest_post_number": 2,148 "image_url": null,149 "created_at": "2024-11-17T07:26:52.131Z",150 "last_posted_at": "2024-11-17T21:03:13.613Z",151 "bumped": true,152 "bumped_at": "2024-11-18T08:58:42.971Z",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": 1,164 "views": 117,165 "category_id": 1,166 "featured_link": null,167 "has_accepted_answer": true,168 "posters": [169 {170 "extras": null,171 "description": "Original Poster",172 "user": {173 "id": 50872,174 "username": "laro",175 "name": "amit",176 "avatar_template": "/user_avatar/discuss.pytorch.org/laro/{size}/47125_2.png",177 "trust_level": 1178 }179 },180 {181 "extras": "latest",182 "description": "Most Recent Poster, Accepted Answer",183 "user": {184 "id": 18088,185 "username": "KFrank",186 "name": "K. Frank",187 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",188 "trust_level": 2189 }190 }191 ]192 },193 {194 "fancy_title": "Loading model from checkpoint results differ to loading model directly",195 "id": 212514,196 "title": "Loading model from checkpoint results differ to loading model directly",197 "slug": "loading-model-from-checkpoint-results-differ-to-loading-model-directly",198 "posts_count": 3,199 "reply_count": 1,200 "highest_post_number": 3,201 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/5/f/5f8b63b57c5fb949f5ab5ca1980be73ad1741806_2_1024x880.png",202 "created_at": "2024-11-04T17:40:35.061Z",203 "last_posted_at": "2024-11-06T11:09:50.739Z",204 "bumped": true,205 "bumped_at": "2024-11-06T11:09:50.739Z",206 "archetype": "regular",207 "unseen": false,208 "pinned": false,209 "unpinned": null,210 "visible": true,211 "closed": false,212 "archived": false,213 "bookmarked": null,214 "liked": null,215 "tags_descriptions": {},216 "like_count": 0,217 "views": 291,218 "category_id": 1,219 "featured_link": null,220 "has_accepted_answer": true,221 "posters": [222 {223 "extras": "latest",224 "description": "Original Poster, Most Recent Poster, Accepted Answer",225 "user": {226 "id": 71636,227 "username": "sophiamaedler",228 "name": "Sophia Mädler",229 "avatar_template": "/user_avatar/discuss.pytorch.org/sophiamaedler/{size}/66166_2.png",230 "trust_level": 1231 }232 },233 {234 "extras": null,235 "description": "Frequent Poster",236 "user": {237 "id": 3534,238 "username": "ptrblck",239 "name": "",240 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",241 "admin": true,242 "moderator": true,243 "trust_level": 2244 }245 }246 ]247 },248 {249 "fancy_title": "Pytorch geometric temporal mamba installation",250 "id": 212651,251 "title": "Pytorch geometric temporal mamba installation",252 "slug": "pytorch-geometric-temporal-mamba-installation",253 "posts_count": 4,254 "reply_count": 2,255 "highest_post_number": 4,256 "image_url": null,257 "created_at": "2024-11-07T08:55:00.714Z",258 "last_posted_at": "2024-11-07T09:40:49.990Z",259 "bumped": true,260 "bumped_at": "2024-11-07T09:40:49.990Z",261 "archetype": "regular",262 "unseen": false,263 "pinned": false,264 "unpinned": null,265 "visible": true,266 "closed": false,267 "archived": false,268 "bookmarked": null,269 "liked": null,270 "tags_descriptions": {},271 "like_count": 0,272 "views": 615,273 "category_id": 1,274 "featured_link": null,275 "has_accepted_answer": false,276 "posters": [277 {278 "extras": null,279 "description": "Original Poster",280 "user": {281 "id": 80744,282 "username": "Charitini_S",283 "name": "Charitini S",284 "avatar_template": "/user_avatar/discuss.pytorch.org/charitini_s/{size}/73099_2.png",285 "trust_level": 1286 }287 },288 {289 "extras": "latest",290 "description": "Most Recent Poster",291 "user": {292 "id": 80724,293 "username": "paulge",294 "name": "",295 "avatar_template": "/letter_avatar_proxy/v4/letter/p/82dd89/{size}.png",296 "trust_level": 2297 }298 }299 ]300 },301 {302 "fancy_title": "I met strange error when train rwkv",303 "id": 214360,304 "title": "I met strange error when train rwkv",305 "slug": "i-met-strange-error-when-train-rwkv",306 "posts_count": 9,307 "reply_count": 7,308 "highest_post_number": 9,309 "image_url": null,310 "created_at": "2024-12-18T13:10:15.024Z",311 "last_posted_at": "2024-12-19T03:10:04.653Z",312 "bumped": true,313 "bumped_at": "2024-12-19T03:10:04.653Z",314 "archetype": "regular",315 "unseen": false,316 "pinned": false,317 "unpinned": null,318 "visible": true,319 "closed": false,320 "archived": false,321 "bookmarked": null,322 "liked": null,323 "tags_descriptions": {},324 "like_count": 0,325 "views": 165,326 "category_id": 1,327 "featured_link": null,328 "has_accepted_answer": false,329 "posters": [330 {331 "extras": null,332 "description": "Original Poster",333 "user": {334 "id": 81570,335 "username": "ddddewang0425",336 "name": "ddddewang0425",337 "avatar_template": "/user_avatar/discuss.pytorch.org/ddddewang0425/{size}/74590_2.png",338 "trust_level": 0339 }340 },341 {342 "extras": "latest",343 "description": "Most Recent Poster",344 "user": {345 "id": 3534,346 "username": "ptrblck",347 "name": "",348 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",349 "admin": true,350 "moderator": true,351 "trust_level": 2352 }353 }354 ]355 }356 ],357 "tags_descriptions": {},358 "fancy_title": "SciPy package in PyTorch model",359 "id": 200946,360 "title": "SciPy package in PyTorch model",361 "posts_count": 1,362 "created_at": "2024-04-15T21:33:29.823Z",363 "views": 148,364 "reply_count": 0,365 "like_count": 0,366 "last_posted_at": "2024-04-15T21:33:29.978Z",367 "visible": true,368 "closed": false,369 "archived": false,370 "has_summary": false,371 "archetype": "regular",372 "slug": "scipy-package-in-pytorch-model",373 "category_id": 1,374 "word_count": 21,375 "deleted_at": null,376 "user_id": 73940,377 "featured_link": null,378 "pinned_globally": false,379 "pinned_at": null,380 "pinned_until": null,381 "image_url": null,382 "slow_mode_seconds": 0,383 "draft": null,384 "draft_key": "topic_200946",385 "draft_sequence": null,386 "unpinned": null,387 "pinned": false,388 "current_post_number": 1,389 "highest_post_number": 1,390 "deleted_by": null,391 "actions_summary": [392 {393 "id": 4,394 "count": 0,395 "hidden": false,396 "can_act": false397 },398 {399 "id": 8,400 "count": 0,401 "hidden": false,402 "can_act": false403 },404 {405 "id": 10,406 "count": 0,407 "hidden": false,408 "can_act": false409 },410 {411 "id": 7,412 "count": 0,413 "hidden": false,414 "can_act": false415 }416 ],417 "chunk_size": 20,418 "bookmarked": false,419 "topic_timer": null,420 "message_bus_last_id": 0,421 "participant_count": 1,422 "show_read_indicator": false,423 "thumbnails": null,424 "slow_mode_enabled_until": null,425 "can_vote": false,426 "vote_count": 0,427 "user_voted": false,428 "discourse_zendesk_plugin_zendesk_id": null,429 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",430 "details": {431 "can_edit": false,432 "notification_level": 1,433 "participants": [434 {435 "id": 73940,436 "username": "Saimon",437 "name": "Amirul Islam Saimon",438 "avatar_template": "/letter_avatar_proxy/v4/letter/s/7cd45c/{size}.png",439 "post_count": 1,440 "primary_group_name": null,441 "flair_name": null,442 "flair_url": null,443 "flair_color": null,444 "flair_bg_color": null,445 "flair_group_id": null,446 "trust_level": 1447 }448 ],449 "created_by": {450 "id": 73940,451 "username": "Saimon",452 "name": "Amirul Islam Saimon",453 "avatar_template": "/letter_avatar_proxy/v4/letter/s/7cd45c/{size}.png"454 },455 "last_poster": {456 "id": 73940,457 "username": "Saimon",458 "name": "Amirul Islam Saimon",459 "avatar_template": "/letter_avatar_proxy/v4/letter/s/7cd45c/{size}.png"460 }461 },462 "bookmarks": []463 },464 {465 "post_stream": {466 "posts": [467 {468 "id": 439388,469 "name": "",470 "username": "randomuserT",471 "avatar_template": "/letter_avatar_proxy/v4/letter/r/f19dbf/{size}.png",472 "created_at": "2024-04-15T20:29:14.102Z",473 "cooked": "<p>I am using pytorch distributed api with gloo as backend (device=cpu) to send activations between a client process to a server process.</p>\n<p>However, I find that somehow the grad_fn property of the activations tensor is no longer present when the tensor is received on the server, while it is present at the client-side at the time of sending.<br>\nI was under the impression that I can use pytorch distributed API for this very use case of also including the grad_fn when sending tensors back and forth, is this not possible?</p>\n<p>Client process;</p>\n<pre data-code-wrap=\"python\"><code class=\"lang-python\">inputs, labels = data\ninputs, labels = inputs.to(device), labels.to(device)\n\nclient_1_optimizer.zero_grad()\nclient_1_activations = client_1_model(inputs)\nclient_1_activations.retain_grad()\nclient_1_activations = client_1_activations.to(device)\n# client_1_activations.grad_fn is <MaxPool2DWithIndicesBackward0 object at 0x00000158932CC7C0> here\ndist.send(tensor=client_1_activations, dst=0)\n</code></pre>\n<p>Server process;</p>\n<pre data-code-wrap=\"python\"><code class=\"lang-python\"># Reserving memory for the incoming activations tensor\nclient_1_activations = torch.zeros((4, 6, 14, 14), requires_grad=True)\nclient_1_activations = client_1_activations.to(device)\ndist.recv(tensor=client_1_activations, src=1)\n\n# Somehow client_1_activations .grad_fn is None here?\n</code></pre>\n<p>However, when following the example that can be found at <a href=\"https://medium.com/@esaliya/pytorch-distributed-with-mpi-acb84b3ae5fd\" rel=\"noopener nofollow ugc\">url</a>, the received tensor does in fact still contain the grad_fn, as I was expecting as well;</p>\n<pre><code class=\"lang-auto\">import os\n\nimport torch\nimport torch.distributed as dist\nfrom torch.multiprocessing import Process\n\n\ndef run(rank):\n print(f\"I am {rank}\")\n\n device = torch.device(\"cpu\")\n\n tensor = torch.zeros(1, requires_grad=True)\n tensor = tensor.mean()\n tensor = tensor.to(device)\n\n if rank == 0:\n # Send the tensor to process 1\n print(\"sending: {}\".format(tensor.grad_fn))\n dist.send(tensor=tensor, dst=1)\n print(\"sent\")\n else:\n # Receive tensor from process 0\n dist.recv(tensor=tensor, src=0)\n print(\"received tensor {}\".format(tensor.grad_fn))\n\ndef init_process(rank, size, backend='gloo'):\n \"\"\" Initialize the distributed environment. \"\"\"\n os.environ['MASTER_ADDR'] = 'localhost'\n os.environ['MASTER_PORT'] = '29500'\n dist.init_process_group(backend, rank=rank, world_size=size)\n run(rank)\n\nif __name__ == \"__main__\":\n size = 2\n processes = []\n for rank in range(size):\n p = Process(target=init_process, args=(rank, size))\n p.start()\n processes.append(p)\n for p in processes:\n p.join()\n</code></pre>\n<p>What am I doing wrong here? Any help would be much appreciated</p>",474 "post_number": 1,475 "post_type": 1,476 "posts_count": 1,477 "updated_at": "2024-04-15T20:32:25.207Z",478 "reply_count": 0,479 "reply_to_post_number": null,480 "quote_count": 0,481 "incoming_link_count": 6,482 "reads": 2,483 "readers_count": 1,484 "score": 30.4,485 "yours": false,486 "topic_id": 200939,487 "topic_slug": "distributed-recv-function-removes-grad-fn-of-communicated-tensor",488 "display_username": "",489 "primary_group_name": null,490 "flair_name": null,491 "flair_url": null,492 "flair_bg_color": null,493 "flair_color": null,494 "flair_group_id": null,495 "badges_granted": [],496 "version": 3,497 "can_edit": false,498 "can_delete": false,499 "can_recover": false,500 "can_see_hidden_post": false,501 "can_wiki": false,502 "link_counts": [503 {504 "url": "https://medium.com/@esaliya/pytorch-distributed-with-mpi-acb84b3ae5fd",505 "internal": false,506 "reflection": false,507 "title": "PyTorch Distributed with MPI. TL;DR: mpirun -np 2 python… | by Saliya Ekanayake | Medium",508 "clicks": 0509 }510 ],511 "read": true,512 "user_title": null,513 "bookmarked": false,514 "actions_summary": [],515 "moderator": false,516 "admin": false,517 "staff": false,518 "user_id": 74971,519 "hidden": false,520 "trust_level": 1,521 "deleted_at": null,522 "user_deleted": false,523 "edit_reason": null,524 "can_view_edit_history": true,525 "wiki": false,526 "post_url": "/t/distributed-recv-function-removes-grad-fn-of-communicated-tensor/200939/1",527 "can_accept_answer": false,528 "can_unaccept_answer": false,529 "accepted_answer": false,530 "topic_accepted_answer": null,531 "can_vote": false532 }533 ],534 "stream": [535 439388536 ]537 },538 "timeline_lookup": [539 [540 1,541 558542 ]543 ],544 "suggested_topics": [545 {546 "fancy_title": "Matmul mixed dtypes",547 "id": 216044,548 "title": "Matmul mixed dtypes",549 "slug": "matmul-mixed-dtypes",550 "posts_count": 1,551 "reply_count": 0,552 "highest_post_number": 1,553 "image_url": null,554 "created_at": "2025-01-30T10:34:26.662Z",555 "last_posted_at": "2025-01-30T10:34:26.702Z",556 "bumped": true,557 "bumped_at": "2025-01-30T10:34:26.702Z",558 "archetype": "regular",559 "unseen": false,560 "pinned": false,561 "unpinned": null,562 "visible": true,563 "closed": false,564 "archived": false,565 "bookmarked": null,566 "liked": null,567 "tags_descriptions": {},568 "like_count": 0,569 "views": 107,570 "category_id": 1,571 "featured_link": null,572 "has_accepted_answer": false,573 "posters": [574 {575 "extras": "latest single",576 "description": "Original Poster, Most Recent Poster",577 "user": {578 "id": 82397,579 "username": "Evgeni_Burovski",580 "name": "Evgeni Burovski",581 "avatar_template": "/user_avatar/discuss.pytorch.org/evgeni_burovski/{size}/75379_2.png",582 "trust_level": 0583 }584 }585 ]586 },587 {588 "fancy_title": "Q: Trying to run Mandelbrot on GPU via PyTorch, but not seeing speed-up",589 "id": 213528,590 "title": "Q: Trying to run Mandelbrot on GPU via PyTorch, but not seeing speed-up",591 "slug": "q-trying-to-run-mandelbrot-on-gpu-via-pytorch-but-not-seeing-speed-up",592 "posts_count": 5,593 "reply_count": 2,594 "highest_post_number": 5,595 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/b/b/bb7f1190813ce66ca53039c469cf71a315b39d5e_2_1024x673.jpeg",596 "created_at": "2024-11-27T14:37:49.259Z",597 "last_posted_at": "2024-11-30T14:39:48.153Z",598 "bumped": true,599 "bumped_at": "2024-11-30T14:39:48.153Z",600 "archetype": "regular",601 "unseen": false,602 "pinned": false,603 "unpinned": null,604 "visible": true,605 "closed": false,606 "archived": false,607 "bookmarked": null,608 "liked": null,609 "tags_descriptions": {},610 "like_count": 0,611 "views": 306,612 "category_id": 1,613 "featured_link": null,614 "has_accepted_answer": true,615 "posters": [616 {617 "extras": "latest",618 "description": "Original Poster, Most Recent Poster",619 "user": {620 "id": 81164,621 "username": "Rajeev_Raizada",622 "name": "Rajeev Raizada",623 "avatar_template": "/user_avatar/discuss.pytorch.org/rajeev_raizada/{size}/74226_2.png",624 "trust_level": 0625 }626 },627 {628 "extras": null,629 "description": "Frequent Poster, Accepted Answer",630 "user": {631 "id": 3534,632 "username": "ptrblck",633 "name": "",634 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",635 "admin": true,636 "moderator": true,637 "trust_level": 2638 }639 },640 {641 "extras": null,642 "description": "Frequent Poster",643 "user": {644 "id": 81166,645 "username": "lennarteingunia",646 "name": "Lennart Eing",647 "avatar_template": "/letter_avatar_proxy/v4/letter/l/cdc98d/{size}.png",648 "trust_level": 0649 }650 }651 ]652 },653 {654 "fancy_title": "Best way to find a specific tensor within a model",655 "id": 214277,656 "title": "Best way to find a specific tensor within a model",657 "slug": "best-way-to-find-a-specific-tensor-within-a-model",658 "posts_count": 5,659 "reply_count": 2,660 "highest_post_number": 5,661 "image_url": null,662 "created_at": "2024-12-16T15:35:30.104Z",663 "last_posted_at": "2024-12-16T16:49:25.910Z",664 "bumped": true,665 "bumped_at": "2024-12-16T16:49:25.910Z",666 "archetype": "regular",667 "unseen": false,668 "pinned": false,669 "unpinned": null,670 "visible": true,671 "closed": false,672 "archived": false,673 "bookmarked": null,674 "liked": null,675 "tags_descriptions": {},676 "like_count": 2,677 "views": 59,678 "category_id": 1,679 "featured_link": null,680 "has_accepted_answer": true,681 "posters": [682 {683 "extras": "latest",684 "description": "Original Poster, Most Recent Poster, Accepted Answer",685 "user": {686 "id": 6296,687 "username": "pytorcher",688 "name": "",689 "avatar_template": "/letter_avatar_proxy/v4/letter/p/7ea924/{size}.png",690 "trust_level": 1691 }692 },693 {694 "extras": null,695 "description": "Frequent Poster",696 "user": {697 "id": 211,698 "username": "albanD",699 "name": "Alban D",700 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",701 "admin": true,702 "moderator": true,703 "trust_level": 4704 }705 }706 ]707 },708 {709 "fancy_title": "Is torch2.4.1 compatible with CUDA12.5",710 "id": 213511,711 "title": "Is torch2.4.1 compatible with CUDA12.5",712 "slug": "is-torch2-4-1-compatible-with-cuda12-5",713 "posts_count": 4,714 "reply_count": 0,715 "highest_post_number": 5,716 "image_url": null,717 "created_at": "2024-11-27T11:34:39.926Z",718 "last_posted_at": "2024-11-27T13:50:34.682Z",719 "bumped": true,720 "bumped_at": "2024-11-27T13:50:34.682Z",721 "archetype": "regular",722 "unseen": false,723 "pinned": false,724 "unpinned": null,725 "visible": true,726 "closed": false,727 "archived": false,728 "bookmarked": null,729 "liked": null,730 "visibility_reason_id": 1,731 "tags_descriptions": {},732 "like_count": 0,733 "views": 290,734 "category_id": 1,735 "featured_link": null,736 "has_accepted_answer": false,737 "posters": [738 {739 "extras": null,740 "description": "Original Poster",741 "user": {742 "id": 81160,743 "username": "Pied-Piper1",744 "name": "Paradox",745 "avatar_template": "/user_avatar/discuss.pytorch.org/pied-piper1/{size}/74224_2.png",746 "trust_level": 0747 }748 },749 {750 "extras": null,751 "description": "Frequent Poster",752 "user": {753 "id": -1,754 "username": "system",755 "name": "system",756 "avatar_template": "/uploads/default/original/2X/3/38d28fd067a1a8f263e14507942b2e38e49b771a.png",757 "admin": true,758 "moderator": true,759 "trust_level": 4760 }761 },762 {763 "extras": "latest",764 "description": "Most Recent Poster",765 "user": {766 "id": 3534,767 "username": "ptrblck",768 "name": "",769 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",770 "admin": true,771 "moderator": true,772 "trust_level": 2773 }774 }775 ]776 },777 {778 "fancy_title": "Optimizer.step() calls torch.cuda.synchronize()",779 "id": 216162,780 "title": "Optimizer.step() calls torch.cuda.synchronize()",781 "slug": "optimizer-step-calls-torch-cuda-synchronize",782 "posts_count": 4,783 "reply_count": 1,784 "highest_post_number": 4,785 "image_url": null,786 "created_at": "2025-02-03T05:00:39.102Z",787 "last_posted_at": "2025-02-04T01:02:16.406Z",788 "bumped": true,789 "bumped_at": "2025-02-04T01:02:16.406Z",790 "archetype": "regular",791 "unseen": false,792 "pinned": false,793 "unpinned": null,794 "visible": true,795 "closed": false,796 "archived": false,797 "bookmarked": null,798 "liked": null,799 "tags_descriptions": {},800 "like_count": 1,801 "views": 225,802 "category_id": 1,803 "featured_link": null,804 "has_accepted_answer": false,805 "posters": [806 {807 "extras": null,808 "description": "Original Poster",809 "user": {810 "id": 81347,811 "username": "eliird",812 "name": "Ird",813 "avatar_template": "/user_avatar/discuss.pytorch.org/eliird/{size}/74389_2.png",814 "trust_level": 1815 }816 },817 {818 "extras": "latest",819 "description": "Most Recent Poster",820 "user": {821 "id": 3534,822 "username": "ptrblck",823 "name": "",824 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",825 "admin": true,826 "moderator": true,827 "trust_level": 2828 }829 }830 ]831 }832 ],833 "tags_descriptions": {},834 "fancy_title": "Distributed recv function removes grad_fn of communicated tensor",835 "id": 200939,836 "title": "Distributed recv function removes grad_fn of communicated tensor",837 "posts_count": 1,838 "created_at": "2024-04-15T20:29:14.008Z",839 "views": 171,840 "reply_count": 0,841 "like_count": 0,842 "last_posted_at": "2024-04-15T20:29:14.102Z",843 "visible": true,844 "closed": false,845 "archived": false,846 "has_summary": false,847 "archetype": "regular",848 "slug": "distributed-recv-function-removes-grad-fn-of-communicated-tensor",849 "category_id": 1,850 "word_count": 349,851 "deleted_at": null,852 "user_id": 74971,853 "featured_link": null,854 "pinned_globally": false,855 "pinned_at": null,856 "pinned_until": null,857 "image_url": null,858 "slow_mode_seconds": 0,859 "draft": null,860 "draft_key": "topic_200939",861 "draft_sequence": null,862 "unpinned": null,863 "pinned": false,864 "current_post_number": 1,865 "highest_post_number": 1,866 "deleted_by": null,867 "actions_summary": [868 {869 "id": 4,870 "count": 0,871 "hidden": false,872 "can_act": false873 },874 {875 "id": 8,876 "count": 0,877 "hidden": false,878 "can_act": false879 },880 {881 "id": 10,882 "count": 0,883 "hidden": false,884 "can_act": false885 },886 {887 "id": 7,888 "count": 0,889 "hidden": false,890 "can_act": false891 }892 ],893 "chunk_size": 20,894 "bookmarked": false,895 "topic_timer": null,896 "message_bus_last_id": 0,897 "participant_count": 1,898 "show_read_indicator": false,899 "thumbnails": null,900 "slow_mode_enabled_until": null,901 "can_vote": false,902 "vote_count": 0,903 "user_voted": false,904 "discourse_zendesk_plugin_zendesk_id": null,905 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",906 "details": {907 "can_edit": false,908 "notification_level": 1,909 "participants": [910 {911 "id": 74971,912 "username": "randomuserT",913 "name": "",914 "avatar_template": "/letter_avatar_proxy/v4/letter/r/f19dbf/{size}.png",915 "post_count": 1,916 "primary_group_name": null,917 "flair_name": null,918 "flair_url": null,919 "flair_color": null,920 "flair_bg_color": null,921 "flair_group_id": null,922 "trust_level": 1923 }924 ],925 "created_by": {926 "id": 74971,927 "username": "randomuserT",928 "name": "",929 "avatar_template": "/letter_avatar_proxy/v4/letter/r/f19dbf/{size}.png"930 },931 "last_poster": {932 "id": 74971,933 "username": "randomuserT",934 "name": "",935 "avatar_template": "/letter_avatar_proxy/v4/letter/r/f19dbf/{size}.png"936 }937 },938 "bookmarks": []939 },940 {941 "post_stream": {942 "posts": [943 {944 "id": 439197,945 "name": "Wellspring Praise",946 "username": "Wells",947 "avatar_template": "/user_avatar/discuss.pytorch.org/wells/{size}/69216_2.png",948 "created_at": "2024-04-13T22:10:06.323Z",949 "cooked": "<p>I don’t understand why my model produces this error, even when the inputs passed into the convolutional layers are correct. Here is my code and the resulting error</p>\n<p>Code:<br>\nclass EmotionModel(ImageClassificationBase):<br>\ndef <strong>init</strong>(self, channel_in, num_classes):<br>\nsuper().<strong>init</strong>()<br>\nself.conv1 = nn.Sequential(<br>\nnn.Conv2d(channel_in, 64, kernel_size = 3, padding = 1), # in: 3 * 96 * 96<br>\nnn.BatchNorm2d(64),<br>\nnn.ReLU() # out: 64 * 96 * 96<br>\n)<br>\nself.conv2 = nn.Sequential(<br>\nnn.Conv2d(64, 128, kernel_size = 3, padding = 1), # in: 64 * 96 * 96<br>\nnn.BatchNorm2d(128),<br>\nnn.ReLU(),<br>\nnn.MaxPool2d(2) # out: 128 * 48 * 48<br>\n)<br>\nself.res1 = nn.Sequential(<br>\nnn.Conv2d(128, 128, kernel_size = 3, padding = 1), # in: 128 * 48 * 48<br>\nnn.BatchNorm2d(128),<br>\nnn.ReLU(), # out: 128 * 48 * 48</p>\n<pre><code> nn.Conv2d(128, 128, kernel_size = 3, padding = 1), # in: 128 * 48 * 48\n nn.BatchNorm2d(128),\n nn.ReLU(), # out: 128 * 48 * 48\n\n nn.Conv2d(128, 128, kernel_size = 3, padding = 1), # in: 128 * 48 * 48\n nn.BatchNorm2d(128),\n nn.ReLU() # out: 128 * 48 * 48\n )\n self.conv3 = nn.Sequential(\n nn.Conv2d(128, 256, kernel_size = 3, padding = 1), # in: 128 * 48 * 48\n nn.BatchNorm2d(256),\n nn.ReLU(),\n nn.MaxPool2d(2) # out: 256 * 24 * 24\n )\n self.conv4 = nn.Sequential(\n nn.Conv2d(256, 512, kernel_size = 3, padding = 1), # in: 256 * 24 * 24\n nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.MaxPool2d(2) # out: 512 * 12 * 12\n )\n self.res2 = nn.Sequential(\n nn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12\n nn.BatchNorm2d(512),\n nn.ReLU(), # out: 512 * 12 * 12\n \n nn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12\n nn.BatchNorm2d(512),\n nn.ReLU(), # 512 * 12 * 12\n\n nn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12\n nn.BatchNorm2d(512),\n nn.ReLU() # out: 512 * 12 * 12\n )\n self.conv5 = nn.Sequential(\n nn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12\n nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.MaxPool2d(3) # out: 512 * 4 * 4\n )\n self.classifier = nn.Sequential(\n nn.MaxPool2d(4), # in: 512 * 4 * 4\n nn.Flatten(),\n nn.Dropout(0.2),\n nn.Linear(512, num_classes) # out: 512 * 1 * 1\n )\n\ndef forward(self, x):\n out = self.conv1(x)\n out = self.conv2(out)\n out = self.res1(out) + out\n out = self.conv3(out)\n out = self.conv4(out)\n out = self.res2(out) + out\n out = self.conv5(out)\n out = self.classifier(out)\n return out\n</code></pre>\n<p>Error:</p>\n<p>RuntimeError Traceback (most recent call last)<br>\nCell In[26], line 1<br>\n----> 1 history = [evaluate(model, valid_dataloader)]</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\utils_contextlib.py:115, in context_decorator..decorate_context(*args, **kwargs)<br>\n112 <span class=\"mention\">@functools.wraps</span>(func)<br>\n113 def decorate_context(*args, **kwargs):<br>\n114 with ctx_factory():<br>\n → 115 return func(*args, **kwargs)</p>\n<p>Cell In[18], line 4, in evaluate(model, val_loader)<br>\n1 <span class=\"mention\">@torch.no_grad</span>()<br>\n2 def evaluate(model, val_loader):<br>\n3 model.eval()<br>\n----> 4 outputs = [model.validation_step(batch) for batch in val_loader]<br>\n5 return model.validation_epoch_end(outputs)</p>\n<p>Cell In[18], line 4, in (.0)<br>\n1 <span class=\"mention\">@torch.no_grad</span>()<br>\n2 def evaluate(model, val_loader):<br>\n3 model.eval()<br>\n----> 4 outputs = [model.validation_step(batch) for batch in val_loader]<br>\n5 return model.validation_epoch_end(outputs)</p>\n<p>Cell In[15], line 10, in ImageClassificationBase.validation_step(self, batch)<br>\n8 def validation_step(self, batch):<br>\n9 images, labels = batch<br>\n—> 10 out = self(images)<br>\n11 loss = F.cross_entropy(out, labels)<br>\n12 acc = accuracy(out, labels)</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\module.py:1511, in Module._wrapped_call_impl(self, *args, **kwargs)<br>\n1509 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]<br>\n1510 else:<br>\n → 1511 return self._call_impl(*args, **kwargs)</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\module.py:1520, in Module._call_impl(self, *args, **kwargs)<br>\n1515 # If we don’t have any hooks, we want to skip the rest of the logic in<br>\n1516 # this function, and just call forward.<br>\n1517 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks<br>\n1518 or _global_backward_pre_hooks or _global_backward_hooks<br>\n1519 or _global_forward_hooks or _global_forward_pre_hooks):<br>\n → 1520 return forward_call(*args, **kwargs)<br>\n1522 try:<br>\n1523 result = None</p>\n<p>Cell In[16], line 71, in EmotionModel.forward(self, x)<br>\n69 out = self.res1(out) + out<br>\n70 out = self.conv3(out)<br>\n—> 71 out = self.conv4(out)<br>\n72 out = self.res2(out) + out<br>\n73 out = self.conv4(out)</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\module.py:1511, in Module._wrapped_call_impl(self, *args, **kwargs)<br>\n1509 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]<br>\n1510 else:<br>\n → 1511 return self._call_impl(*args, **kwargs)</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\module.py:1520, in Module._call_impl(self, *args, **kwargs)<br>\n1515 # If we don’t have any hooks, we want to skip the rest of the logic in<br>\n1516 # this function, and just call forward.<br>\n1517 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks<br>\n1518 or _global_backward_pre_hooks or _global_backward_hooks<br>\n1519 or _global_forward_hooks or _global_forward_pre_hooks):<br>\n → 1520 return forward_call(*args, **kwargs)<br>\n1522 try:<br>\n1523 result = None</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\container.py:217, in Sequential.forward(self, input)<br>\n215 def forward(self, input):<br>\n216 for module in self:<br>\n → 217 input = module(input)<br>\n218 return input</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\module.py:1511, in Module._wrapped_call_impl(self, *args, **kwargs)<br>\n1509 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]<br>\n1510 else:<br>\n → 1511 return self._call_impl(*args, **kwargs)</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\module.py:1520, in Module._call_impl(self, *args, **kwargs)<br>\n1515 # If we don’t have any hooks, we want to skip the rest of the logic in<br>\n1516 # this function, and just call forward.<br>\n1517 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks<br>\n1518 or _global_backward_pre_hooks or _global_backward_hooks<br>\n1519 or _global_forward_hooks or _global_forward_pre_hooks):<br>\n → 1520 return forward_call(*args, **kwargs)<br>\n1522 try:<br>\n1523 result = None</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\conv.py:460, in Conv2d.forward(self, input)<br>\n459 def forward(self, input: Tensor) → Tensor:<br>\n → 460 return self._conv_forward(input, self.weight, self.bias)</p>\n<p>File ~\\anaconda3\\Lib\\site-packages\\torch\\nn\\modules\\conv.py:456, in Conv2d._conv_forward(self, input, weight, bias)<br>\n452 if self.padding_mode != ‘zeros’:<br>\n453 return F.conv2d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode),<br>\n454 weight, bias, self.stride,<br>\n455 _pair(0), self.dilation, self.groups)<br>\n → 456 return F.conv2d(input, weight, bias, self.stride,<br>\n457 self.padding, self.dilation, self.groups)</p>\n<p>RuntimeError: Given groups=1, weight of size [512, 512, 3, 3], expected input[200, 256, 24, 24] to have 512 channels, but got 256 channels instead</p>",950 "post_number": 1,951 "post_type": 1,952 "posts_count": 6,953 "updated_at": "2024-04-13T22:10:06.323Z",954 "reply_count": 0,955 "reply_to_post_number": null,956 "quote_count": 0,957 "incoming_link_count": 569,958 "reads": 11,959 "readers_count": 10,960 "score": 2847.2,961 "yours": false,962 "topic_id": 200815,963 "topic_slug": "runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead",964 "display_username": "Wellspring Praise",965 "primary_group_name": null,966 "flair_name": null,967 "flair_url": null,968 "flair_bg_color": null,969 "flair_color": null,970 "flair_group_id": null,971 "badges_granted": [],972 "version": 1,973 "can_edit": false,974 "can_delete": false,975 "can_recover": false,976 "can_see_hidden_post": false,977 "can_wiki": false,978 "read": true,979 "user_title": null,980 "bookmarked": false,981 "actions_summary": [],982 "moderator": false,983 "admin": false,984 "staff": false,985 "user_id": 74961,986 "hidden": false,987 "trust_level": 0,988 "deleted_at": null,989 "user_deleted": false,990 "edit_reason": null,991 "can_view_edit_history": true,992 "wiki": false,993 "post_url": "/t/runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead/200815/1",994 "can_accept_answer": false,995 "can_unaccept_answer": false,996 "accepted_answer": false,997 "topic_accepted_answer": null,998 "can_vote": false999 },1000 {1001 "id": 439202,1002 "name": "",1003 "username": "ptrblck",1004 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1005 "created_at": "2024-04-14T02:38:28.868Z",1006 "cooked": "<p>The stacktrace does not match the error message as <code>self.conv4</code> fails while it should expect 256 input channels. Are you able to reproduce the issue using your posted code? If so, could you format it and share the input shape?</p>",1007 "post_number": 2,1008 "post_type": 1,1009 "posts_count": 6,1010 "updated_at": "2024-04-14T02:38:28.868Z",1011 "reply_count": 1,1012 "reply_to_post_number": null,1013 "quote_count": 0,1014 "incoming_link_count": 0,1015 "reads": 9,1016 "readers_count": 8,1017 "score": 6.8,1018 "yours": false,1019 "topic_id": 200815,1020 "topic_slug": "runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead",1021 "display_username": "",1022 "primary_group_name": null,1023 "flair_name": null,1024 "flair_url": null,1025 "flair_bg_color": null,1026 "flair_color": null,1027 "flair_group_id": null,1028 "badges_granted": [],1029 "version": 1,1030 "can_edit": false,1031 "can_delete": false,1032 "can_recover": false,1033 "can_see_hidden_post": false,1034 "can_wiki": false,1035 "read": true,1036 "user_title": "",1037 "bookmarked": false,1038 "actions_summary": [],1039 "moderator": true,1040 "admin": true,1041 "staff": true,1042 "user_id": 3534,1043 "hidden": false,1044 "trust_level": 2,1045 "deleted_at": null,1046 "user_deleted": false,1047 "edit_reason": null,1048 "can_view_edit_history": true,1049 "wiki": false,1050 "post_url": "/t/runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead/200815/2",1051 "can_accept_answer": false,1052 "can_unaccept_answer": false,1053 "accepted_answer": false,1054 "topic_accepted_answer": null1055 },1056 {1057 "id": 439217,1058 "name": "Wellspring Praise",1059 "username": "Wells",1060 "avatar_template": "/user_avatar/discuss.pytorch.org/wells/{size}/69216_2.png",1061 "created_at": "2024-04-14T07:49:20.000Z",1062 "cooked": "<p>This is the models architecture I built</p>\n<p>class EmotionModel(ImageClassificationBase):<br>\ndef <strong>init</strong>(self, channel_in, num_classes):<br>\nsuper().<strong>init</strong>()<br>\nself.conv1 = nn.Sequential(<br>\nnn.Conv2d(channel_in, 64, kernel_size = 3, padding = 1), # in: 3 * 96 * 96<br>\nnn.BatchNorm2d(64),<br>\nnn.ReLU() # out: 64 * 96 * 96<br>\n)<br>\nself.conv2 = nn.Sequential(<br>\nnn.Conv2d(64, 128, kernel_size = 3, padding = 1), # in: 64 * 96 * 96<br>\nnn.BatchNorm2d(128),<br>\nnn.ReLU(),<br>\nnn.MaxPool2d(2) # out: 128 * 48 * 48<br>\n)<br>\nself.res1 = nn.Sequential(<br>\nnn.Conv2d(128, 128, kernel_size = 3, padding = 1), # in: 128 * 48 * 48<br>\nnn.BatchNorm2d(128),<br>\nnn.ReLU(), # out: 128 * 48 * 48</p>\n<p>nn.Conv2d(128, 128, kernel_size = 3, padding = 1), # in: 128 * 48 * 48<br>\nnn.BatchNorm2d(128),<br>\nnn.ReLU(), # out: 128 * 48 * 48</p>\n<p>nn.Conv2d(128, 128, kernel_size = 3, padding = 1), # in: 128 * 48 * 48<br>\nnn.BatchNorm2d(128),<br>\nnn.ReLU() # out: 128 * 48 * 48<br>\n)<br>\nself.conv3 = nn.Sequential(<br>\nnn.Conv2d(128, 256, kernel_size = 3, padding = 1), # in: 128 * 48 * 48<br>\nnn.BatchNorm2d(256),<br>\nnn.ReLU(),<br>\nnn.MaxPool2d(2) # out: 256 * 24 * 24<br>\n)<br>\nself.conv4 = nn.Sequential(<br>\nnn.Conv2d(256, 512, kernel_size = 3, padding = 1), # in: 256 * 24 * 24<br>\nnn.BatchNorm2d(512),<br>\nnn.ReLU(),<br>\nnn.MaxPool2d(2) # out: 512 * 12 * 12<br>\n)<br>\nself.res2 = nn.Sequential(<br>\nnn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12<br>\nnn.BatchNorm2d(512),<br>\nnn.ReLU(), # out: 512 * 12 * 12</p>\n<p>nn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12<br>\nnn.BatchNorm2d(512),<br>\nnn.ReLU(), # 512 * 12 * 12</p>\n<p>nn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12<br>\nnn.BatchNorm2d(512),<br>\nnn.ReLU() # out: 512 * 12 * 12<br>\n)<br>\nself.conv5 = nn.Sequential(<br>\nnn.Conv2d(512, 512, kernel_size = 3, padding = 1), # in: 512 * 12 * 12<br>\nnn.BatchNorm2d(512),<br>\nnn.ReLU(),<br>\nnn.MaxPool2d(3) # out: 512 * 4 * 4<br>\n)<br>\nself.classifier = nn.Sequential(<br>\nnn.MaxPool2d(4), # in: 512 * 4 * 4<br>\nnn.Flatten(),<br>\nnn.Dropout(0.2),<br>\nnn.Linear(512, num_classes) # out: 8<br>\n)</p>\n<p>def forward(self, x):<br>\nout = self.conv1(x)<br>\nout = self.conv2(out)</p>\n<p>out = self.res1(out) + out</p>\n<p>out = self.conv3(out)<br>\nout = self.conv4(out)</p>\n<p>out = self.res2(out) + out</p>\n<p>out = self.conv5(out)<br>\nout = self.classifier(out)<br>\nreturn out</p>\n<p>So please where and where does that error comes from, also if I want to track the output shape after ach convolutional layer, how can I do that? Thanks</p>",1063 "post_number": 3,1064 "post_type": 1,1065 "posts_count": 6,1066 "updated_at": "2024-04-14T07:51:49.633Z",1067 "reply_count": 1,1068 "reply_to_post_number": 2,1069 "quote_count": 0,1070 "incoming_link_count": 6,1071 "reads": 9,1072 "readers_count": 8,1073 "score": 36.8,1074 "yours": false,1075 "topic_id": 200815,1076 "topic_slug": "runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead",1077 "display_username": "Wellspring Praise",1078 "primary_group_name": null,1079 "flair_name": null,1080 "flair_url": null,1081 "flair_bg_color": null,1082 "flair_color": null,1083 "flair_group_id": null,1084 "badges_granted": [],1085 "version": 1,1086 "can_edit": false,1087 "can_delete": false,1088 "can_recover": false,1089 "can_see_hidden_post": false,1090 "can_wiki": false,1091 "read": true,1092 "user_title": null,1093 "reply_to_user": {1094 "id": 3534,1095 "username": "ptrblck",1096 "name": "",1097 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"1098 },1099 "bookmarked": false,1100 "actions_summary": [],1101 "moderator": false,1102 "admin": false,1103 "staff": false,1104 "user_id": 74961,1105 "hidden": false,1106 "trust_level": 0,1107 "deleted_at": null,1108 "user_deleted": false,1109 "edit_reason": null,1110 "can_view_edit_history": true,1111 "wiki": false,1112 "via_email": true,1113 "post_url": "/t/runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead/200815/3",1114 "can_accept_answer": false,1115 "can_unaccept_answer": false,1116 "accepted_answer": false,1117 "topic_accepted_answer": null1118 },1119 {1120 "id": 439251,1121 "name": "",1122 "username": "ptrblck",1123 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1124 "created_at": "2024-04-14T13:57:24.725Z",1125 "cooked": "<p>Your model works fine using:</p>\n<pre data-code-wrap=\"python\"><code class=\"lang-python\">model = EmotionModel(3, 10)\nx = torch.randn(1, 3, 112, 112)\nout = model(x)\nprint(out.shape)\n# torch.Size([1, 10])\n</code></pre>\n<p>If you get stuck, please follow my previous request in trying to reproduce the issue using your own minimal code snippet first. Once you are able to reproduce it, post it in a formatted way by wrapping it into three backticks ```.</p>",1126 "post_number": 4,1127 "post_type": 1,1128 "posts_count": 6,1129 "updated_at": "2024-04-14T13:57:24.725Z",1130 "reply_count": 1,1131 "reply_to_post_number": 3,1132 "quote_count": 0,1133 "incoming_link_count": 3,1134 "reads": 6,1135 "readers_count": 5,1136 "score": 21.2,1137 "yours": false,1138 "topic_id": 200815,1139 "topic_slug": "runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead",1140 "display_username": "",1141 "primary_group_name": null,1142 "flair_name": null,1143 "flair_url": null,1144 "flair_bg_color": null,1145 "flair_color": null,1146 "flair_group_id": null,1147 "badges_granted": [],1148 "version": 1,1149 "can_edit": false,1150 "can_delete": false,1151 "can_recover": false,1152 "can_see_hidden_post": false,1153 "can_wiki": false,1154 "read": true,1155 "user_title": "",1156 "reply_to_user": {1157 "id": 74961,1158 "username": "Wells",1159 "name": "Wellspring Praise",1160 "avatar_template": "/user_avatar/discuss.pytorch.org/wells/{size}/69216_2.png"1161 },1162 "bookmarked": false,1163 "actions_summary": [],1164 "moderator": true,1165 "admin": true,1166 "staff": true,1167 "user_id": 3534,1168 "hidden": false,1169 "trust_level": 2,1170 "deleted_at": null,1171 "user_deleted": false,1172 "edit_reason": null,1173 "can_view_edit_history": true,1174 "wiki": false,1175 "post_url": "/t/runtimeerror-given-groups-1-weight-of-size-512-512-3-3-expected-input-200-256-24-24-to-have-512-channels-but-got-256-channels-instead/200815/4",1176 "can_accept_answer": false,1177 "can_unaccept_answer": false,1178 "accepted_answer": false,1179 "topic_accepted_answer": null1180 },1181 {1182 "id": 439356,1183 "name": "Wellspring Praise",1184 "username": "Wells",1185 "avatar_template": "/user_avatar/discuss.pytorch.org/wells/{size}/69216_2.png",1186 "created_at": "2024-04-15T16:03:35.000Z",1187 "cooked": "<p>Hello, I wish I could get an understanding of what you mean, but here is a minimal code snippet passing through the model and giving out no error with the same shape as my image tensors</p>\n<pre><code class=\"lang-auto\">x = torch.randn(3, 96, 96)\nprint(x.shape)\nx = to_device(x, device)\nx = x.unsqueeze(0)\nout = model(x)\nout.shape\n</code></pre>\n<pre><code class=\"lang-auto\">torch.Size([3, 96, 96])\n\n</code></pre>\n<p>[58]:</p>\n<pre><code class=\"lang-auto\">torch.Size([1, 8])\n</code></pre>",1188 "post_number": 5,1189 "post_type": 1,1190 "posts_count": 6,1191 "updated_at": "2024-04-15T16:07:09.016Z",1192 "reply_count": 1,1193 "reply_to_post_number": 4,1194 "quote_count": 0,1195 "incoming_link_count": 1,1196 "reads": 7,1197 "readers_count": 6,1198 "score": 11.4,1199 "yours": false,1200 "topic_id": 200815,