Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 341172,7 "name": "Siddharth MV",8 "username": "siddharth_MV",9 "avatar_template": "/user_avatar/discuss.pytorch.org/siddharth_mv/{size}/48580_2.png",10 "created_at": "2022-04-13T04:12:45.884Z",11 "cooked": "<p>I am trying to run a CNN model on aws ec2 instance. It is giving me this error. The same script runs on a different ec2 instance with a different gpu but not on this. I am not able to solve it even though I’ve restarted the kernel, checked output neurons size, etc. I tried training a pretrained model and it is working perfectly with the same dataloaders and script.</p>\n<pre><code class=\"lang-auto\">RuntimeError Traceback (most recent call last)\n/tmp/ipykernel_4008/1924527283.py in <cell line: 3>()\n 5 start_time = time.monotonic()\n 6 \n----> 7 train_loss, train_acc = train(model, loader_train, optimizer, criterion, device=\"cpu\")\n 8 valid_loss, valid_acc = evaluate(model, loader_valid, criterion, device=\"cpu\")\n 9 \n\n/tmp/ipykernel_4008/585199812.py in train(model, iterator, optimizer, criterion, device)\n 13 \n 14 with autocast(enabled=use_amp):\n---> 15 y_pred = model(x)\n 16 \n 17 loss = criterion(y_pred, y)\n\n~/anaconda3/envs/pytorch_p38/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)\n 1100 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks\n 1101 or _global_forward_hooks or _global_forward_pre_hooks):\n-> 1102 return forward_call(*input, **kwargs)\n 1103 # Do not call functions when jit is used\n 1104 full_backward_hooks, non_full_backward_hooks = [], []\n\n/tmp/ipykernel_4008/2249971542.py in forward(self, input)\n 148 \n 149 #MAIN Branch\n--> 150 x = self.qcfem(input)\n 151 #print(x.shape)\n 152 residual = x\n\n~/anaconda3/envs/pytorch_p38/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)\n 1100 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks\n 1101 or _global_forward_hooks or _global_forward_pre_hooks):\n-> 1102 return forward_call(*input, **kwargs)\n 1103 # Do not call functions when jit is used\n 1104 full_backward_hooks, non_full_backward_hooks = [], []\n\n/tmp/ipykernel_4008/2249971542.py in forward(self, input)\n 44 def forward(self, input):\n 45 \n---> 46 w = self.relu(self.batch_norm(self.dilated_conv1(input)))\n 47 \n 48 x = self.relu(self.batch_norm(self.dilated_conv2(input)))\n\n~/anaconda3/envs/pytorch_p38/lib/python3.8/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)\n 1100 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks\n 1101 or _global_forward_hooks or _global_forward_pre_hooks):\n-> 1102 return forward_call(*input, **kwargs)\n 1103 # Do not call functions when jit is used\n 1104 full_backward_hooks, non_full_backward_hooks = [], []\n\n~/anaconda3/envs/pytorch_p38/lib/python3.8/site-packages/torch/nn/modules/conv.py in forward(self, input)\n 444 \n 445 def forward(self, input: Tensor) -> Tensor:\n--> 446 return self._conv_forward(input, self.weight, self.bias)\n 447 \n 448 class Conv3d(_ConvNd):\n\n~/anaconda3/envs/pytorch_p38/lib/python3.8/site-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias)\n 440 weight, bias, self.stride,\n 441 _pair(0), self.dilation, self.groups)\n--> 442 return F.conv2d(input, weight, bias, self.stride,\n 443 self.padding, self.dilation, self.groups)\n 444 \n\nRuntimeError: CUDA error: device-side assert triggered\n</code></pre>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 5,15 "updated_at": "2022-04-13T15:26:33.151Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 98,20 "reads": 5,21 "readers_count": 4,22 "score": 491.0,23 "yours": false,24 "topic_id": 148994,25 "topic_slug": "cuda-error-device-side-assert-triggered-in-aws-ec2",26 "display_username": "Siddharth MV",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": 3,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": 54957,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/cuda-error-device-side-assert-triggered-in-aws-ec2/148994/1",56 "can_accept_answer": false,57 "can_unaccept_answer": false,58 "accepted_answer": false,59 "topic_accepted_answer": true,60 "can_vote": false61 },62 {63 "id": 341175,64 "name": "",65 "username": "ptrblck",66 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",67 "created_at": "2022-04-13T04:29:12.423Z",68 "cooked": "<p>You could run the code via <code>CUDA_LAUNCH_BLOCKING=1 python setup.py args</code> to get the stacktrace pointing to the failing operation. Alternatively, you could also run the script on the CPU which could yield a better error message.</p>",69 "post_number": 2,70 "post_type": 1,71 "posts_count": 5,72 "updated_at": "2022-04-13T04:29:12.423Z",73 "reply_count": 1,74 "reply_to_post_number": null,75 "quote_count": 0,76 "incoming_link_count": 1,77 "reads": 4,78 "readers_count": 3,79 "score": 10.8,80 "yours": false,81 "topic_id": 148994,82 "topic_slug": "cuda-error-device-side-assert-triggered-in-aws-ec2",83 "display_username": "",84 "primary_group_name": null,85 "flair_name": null,86 "flair_url": null,87 "flair_bg_color": null,88 "flair_color": null,89 "flair_group_id": null,90 "badges_granted": [],91 "version": 1,92 "can_edit": false,93 "can_delete": false,94 "can_recover": false,95 "can_see_hidden_post": false,96 "can_wiki": false,97 "read": true,98 "user_title": "",99 "bookmarked": false,100 "actions_summary": [],101 "moderator": true,102 "admin": true,103 "staff": true,104 "user_id": 3534,105 "hidden": false,106 "trust_level": 2,107 "deleted_at": null,108 "user_deleted": false,109 "edit_reason": null,110 "can_view_edit_history": true,111 "wiki": false,112 "post_url": "/t/cuda-error-device-side-assert-triggered-in-aws-ec2/148994/2",113 "can_accept_answer": false,114 "can_unaccept_answer": false,115 "accepted_answer": false,116 "topic_accepted_answer": true117 },118 {119 "id": 341178,120 "name": "Siddharth MV",121 "username": "siddharth_MV",122 "avatar_template": "/user_avatar/discuss.pytorch.org/siddharth_mv/{size}/48580_2.png",123 "created_at": "2022-04-13T04:41:51.233Z",124 "cooked": "<p>Yes I have done both. This is the error I am getting after.</p>",125 "post_number": 3,126 "post_type": 1,127 "posts_count": 5,128 "updated_at": "2022-04-13T04:41:51.233Z",129 "reply_count": 0,130 "reply_to_post_number": 2,131 "quote_count": 0,132 "incoming_link_count": 4,133 "reads": 4,134 "readers_count": 3,135 "score": 20.8,136 "yours": false,137 "topic_id": 148994,138 "topic_slug": "cuda-error-device-side-assert-triggered-in-aws-ec2",139 "display_username": "Siddharth MV",140 "primary_group_name": null,141 "flair_name": null,142 "flair_url": null,143 "flair_bg_color": null,144 "flair_color": null,145 "flair_group_id": null,146 "badges_granted": [],147 "version": 1,148 "can_edit": false,149 "can_delete": false,150 "can_recover": false,151 "can_see_hidden_post": false,152 "can_wiki": false,153 "read": true,154 "user_title": null,155 "reply_to_user": {156 "id": 3534,157 "username": "ptrblck",158 "name": "",159 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"160 },161 "bookmarked": false,162 "actions_summary": [],163 "moderator": false,164 "admin": false,165 "staff": false,166 "user_id": 54957,167 "hidden": false,168 "trust_level": 1,169 "deleted_at": null,170 "user_deleted": false,171 "edit_reason": null,172 "can_view_edit_history": true,173 "wiki": false,174 "post_url": "/t/cuda-error-device-side-assert-triggered-in-aws-ec2/148994/3",175 "can_accept_answer": false,176 "can_unaccept_answer": false,177 "accepted_answer": false,178 "topic_accepted_answer": true179 },180 {181 "id": 341831,182 "name": "Siddharth MV",183 "username": "siddharth_MV",184 "avatar_template": "/user_avatar/discuss.pytorch.org/siddharth_mv/{size}/48580_2.png",185 "created_at": "2022-04-17T08:23:52.071Z",186 "cooked": "<p>I solved the error after struggling with it for a few days. I found out that there was an ‘.ipynb checkpoints’ file in the classes folder. So instead of 5 classes, there were 6. I deleted the file and the problem went away!</p>",187 "post_number": 4,188 "post_type": 1,189 "posts_count": 5,190 "updated_at": "2022-04-17T08:23:52.071Z",191 "reply_count": 1,192 "reply_to_post_number": null,193 "quote_count": 0,194 "incoming_link_count": 2,195 "reads": 3,196 "readers_count": 2,197 "score": 15.6,198 "yours": false,199 "topic_id": 148994,200 "topic_slug": "cuda-error-device-side-assert-triggered-in-aws-ec2",201 "display_username": "Siddharth MV",202 "primary_group_name": null,203 "flair_name": null,204 "flair_url": null,205 "flair_bg_color": null,206 "flair_color": null,207 "flair_group_id": null,208 "badges_granted": [],209 "version": 1,210 "can_edit": false,211 "can_delete": false,212 "can_recover": false,213 "can_see_hidden_post": false,214 "can_wiki": false,215 "read": true,216 "user_title": null,217 "bookmarked": false,218 "actions_summary": [],219 "moderator": false,220 "admin": false,221 "staff": false,222 "user_id": 54957,223 "hidden": false,224 "trust_level": 1,225 "deleted_at": null,226 "user_deleted": false,227 "edit_reason": null,228 "can_view_edit_history": true,229 "wiki": false,230 "post_url": "/t/cuda-error-device-side-assert-triggered-in-aws-ec2/148994/4",231 "can_accept_answer": false,232 "can_unaccept_answer": false,233 "accepted_answer": true,234 "topic_accepted_answer": true235 },236 {237 "id": 341965,238 "name": "",239 "username": "ptrblck",240 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",241 "created_at": "2022-04-18T06:33:27.021Z",242 "cooked": "<p>That’s good to hear! However, both the CPU run as well as the blocking CUDA launches should show the correct error message, so I’m unsure why exactly your setup wasn’t raising it.</p>",243 "post_number": 5,244 "post_type": 1,245 "posts_count": 5,246 "updated_at": "2022-04-18T06:33:27.021Z",247 "reply_count": 0,248 "reply_to_post_number": 4,249 "quote_count": 0,250 "incoming_link_count": 0,251 "reads": 3,252 "readers_count": 2,253 "score": 15.6,254 "yours": false,255 "topic_id": 148994,256 "topic_slug": "cuda-error-device-side-assert-triggered-in-aws-ec2",257 "display_username": "",258 "primary_group_name": null,259 "flair_name": null,260 "flair_url": null,261 "flair_bg_color": null,262 "flair_color": null,263 "flair_group_id": null,264 "badges_granted": [],265 "version": 1,266 "can_edit": false,267 "can_delete": false,268 "can_recover": false,269 "can_see_hidden_post": false,270 "can_wiki": false,271 "read": true,272 "user_title": "",273 "reply_to_user": {274 "id": 54957,275 "username": "siddharth_MV",276 "name": "Siddharth MV",277 "avatar_template": "/user_avatar/discuss.pytorch.org/siddharth_mv/{size}/48580_2.png"278 },279 "bookmarked": false,280 "actions_summary": [281 {282 "id": 2,283 "count": 1284 }285 ],286 "moderator": true,287 "admin": true,288 "staff": true,289 "user_id": 3534,290 "hidden": false,291 "trust_level": 2,292 "deleted_at": null,293 "user_deleted": false,294 "edit_reason": null,295 "can_view_edit_history": true,296 "wiki": false,297 "post_url": "/t/cuda-error-device-side-assert-triggered-in-aws-ec2/148994/5",298 "can_accept_answer": false,299 "can_unaccept_answer": false,300 "accepted_answer": false,301 "topic_accepted_answer": true302 }303 ],304 "stream": [305 341172,306 341175,307 341178,308 341831,309 341965310 ]311 },312 "timeline_lookup": [313 [314 1,315 1292316 ],317 [318 4,319 1288320 ],321 [322 5,323 1287324 ]325 ],326 "suggested_topics": [327 {328 "fancy_title": "Where can I find a version of pytorch which is suitable for CUDA12.8?",329 "id": 217153,330 "title": "Where can I find a version of pytorch which is suitable for CUDA12.8?",331 "slug": "where-can-i-find-a-version-of-pytorch-which-is-suitable-for-cuda12-8",332 "posts_count": 4,333 "reply_count": 1,334 "highest_post_number": 4,335 "image_url": null,336 "created_at": "2025-02-25T14:56:38.018Z",337 "last_posted_at": "2025-02-27T01:07:11.968Z",338 "bumped": true,339 "bumped_at": "2025-02-27T01:07:11.968Z",340 "archetype": "regular",341 "unseen": false,342 "pinned": false,343 "unpinned": null,344 "visible": true,345 "closed": false,346 "archived": false,347 "bookmarked": null,348 "liked": null,349 "tags_descriptions": {},350 "like_count": 0,351 "views": 656,352 "category_id": 1,353 "featured_link": null,354 "has_accepted_answer": false,355 "posters": [356 {357 "extras": null,358 "description": "Original Poster",359 "user": {360 "id": 82924,361 "username": "Nicholas",362 "name": "Nicholas Wang",363 "avatar_template": "/user_avatar/discuss.pytorch.org/nicholas/{size}/75868_2.png",364 "trust_level": 0365 }366 },367 {368 "extras": null,369 "description": "Frequent Poster",370 "user": {371 "id": 3534,372 "username": "ptrblck",373 "name": "",374 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",375 "admin": true,376 "moderator": true,377 "trust_level": 2378 }379 },380 {381 "extras": "latest",382 "description": "Most Recent Poster",383 "user": {384 "id": 82956,385 "username": "long_yi",386 "name": "vee lee",387 "avatar_template": "/letter_avatar_proxy/v4/letter/l/dbc845/{size}.png",388 "trust_level": 0389 }390 }391 ]392 },393 {394 "fancy_title": "Is torch2.4.1 compatible with CUDA12.5",395 "id": 213511,396 "title": "Is torch2.4.1 compatible with CUDA12.5",397 "slug": "is-torch2-4-1-compatible-with-cuda12-5",398 "posts_count": 4,399 "reply_count": 0,400 "highest_post_number": 5,401 "image_url": null,402 "created_at": "2024-11-27T11:34:39.926Z",403 "last_posted_at": "2024-11-27T13:50:34.682Z",404 "bumped": true,405 "bumped_at": "2024-11-27T13:50:34.682Z",406 "archetype": "regular",407 "unseen": false,408 "pinned": false,409 "unpinned": null,410 "visible": true,411 "closed": false,412 "archived": false,413 "bookmarked": null,414 "liked": null,415 "visibility_reason_id": 1,416 "tags_descriptions": {},417 "like_count": 0,418 "views": 290,419 "category_id": 1,420 "featured_link": null,421 "has_accepted_answer": false,422 "posters": [423 {424 "extras": null,425 "description": "Original Poster",426 "user": {427 "id": 81160,428 "username": "Pied-Piper1",429 "name": "Paradox",430 "avatar_template": "/user_avatar/discuss.pytorch.org/pied-piper1/{size}/74224_2.png",431 "trust_level": 0432 }433 },434 {435 "extras": null,436 "description": "Frequent Poster",437 "user": {438 "id": -1,439 "username": "system",440 "name": "system",441 "avatar_template": "/uploads/default/original/2X/3/38d28fd067a1a8f263e14507942b2e38e49b771a.png",442 "admin": true,443 "moderator": true,444 "trust_level": 4445 }446 },447 {448 "extras": "latest",449 "description": "Most Recent Poster",450 "user": {451 "id": 3534,452 "username": "ptrblck",453 "name": "",454 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",455 "admin": true,456 "moderator": true,457 "trust_level": 2458 }459 }460 ]461 },462 {463 "fancy_title": "Linear constraints on trainable network parameters",464 "id": 216334,465 "title": "Linear constraints on trainable network parameters",466 "slug": "linear-constraints-on-trainable-network-parameters",467 "posts_count": 11,468 "reply_count": 9,469 "highest_post_number": 11,470 "image_url": null,471 "created_at": "2025-02-06T21:23:59.485Z",472 "last_posted_at": "2025-06-23T17:52:18.642Z",473 "bumped": true,474 "bumped_at": "2025-06-23T17:52:18.642Z",475 "archetype": "regular",476 "unseen": false,477 "pinned": false,478 "unpinned": null,479 "visible": true,480 "closed": false,481 "archived": false,482 "bookmarked": null,483 "liked": null,484 "tags_descriptions": {},485 "like_count": 0,486 "views": 172,487 "category_id": 1,488 "featured_link": null,489 "has_accepted_answer": true,490 "posters": [491 {492 "extras": null,493 "description": "Original Poster",494 "user": {495 "id": 82524,496 "username": "Mathieu",497 "name": "",498 "avatar_template": "/user_avatar/discuss.pytorch.org/mathieu/{size}/74743_2.png",499 "trust_level": 1500 }501 },502 {503 "extras": "latest",504 "description": "Most Recent Poster, Accepted Answer",505 "user": {506 "id": 18088,507 "username": "KFrank",508 "name": "K. Frank",509 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",510 "trust_level": 2511 }512 }513 ]514 },515 {516 "fancy_title": "Float16 matmul works while bfloat16 throws CUBLAS_STATUS_NOT_SUPPORTED when calling cublasGemmStridedBatchedEx",517 "id": 212129,518 "title": "Float16 matmul works while bfloat16 throws CUBLAS_STATUS_NOT_SUPPORTED when calling cublasGemmStridedBatchedEx",519 "slug": "float16-matmul-works-while-bfloat16-throws-cublas-status-not-supported-when-calling-cublasgemmstridedbatchedex",520 "posts_count": 4,521 "reply_count": 2,522 "highest_post_number": 4,523 "image_url": null,524 "created_at": "2024-10-26T12:14:12.725Z",525 "last_posted_at": "2024-10-27T14:43:23.181Z",526 "bumped": true,527 "bumped_at": "2024-10-27T14:43:23.181Z",528 "archetype": "regular",529 "unseen": false,530 "pinned": false,531 "unpinned": null,532 "visible": true,533 "closed": false,534 "archived": false,535 "bookmarked": null,536 "liked": null,537 "tags_descriptions": {},538 "like_count": 2,539 "views": 138,540 "category_id": 1,541 "featured_link": null,542 "has_accepted_answer": true,543 "posters": [544 {545 "extras": null,546 "description": "Original Poster",547 "user": {548 "id": 65936,549 "username": "Butanium",550 "name": "Clement Dumas",551 "avatar_template": "/user_avatar/discuss.pytorch.org/butanium/{size}/60264_2.png",552 "trust_level": 1553 }554 },555 {556 "extras": "latest",557 "description": "Most Recent Poster, Accepted Answer",558 "user": {559 "id": 3534,560 "username": "ptrblck",561 "name": "",562 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",563 "admin": true,564 "moderator": true,565 "trust_level": 2566 }567 }568 ]569 },570 {571 "fancy_title": "Batch first gru with 2 layers and bidirectional is allergic to batch size > 1",572 "id": 217163,573 "title": "Batch first gru with 2 layers and bidirectional is allergic to batch size > 1",574 "slug": "batch-first-gru-with-2-layers-and-bidirectional-is-allergic-to-batch-size-1",575 "posts_count": 1,576 "reply_count": 0,577 "highest_post_number": 1,578 "image_url": null,579 "created_at": "2025-02-25T22:54:00.646Z",580 "last_posted_at": "2025-02-25T22:54:00.693Z",581 "bumped": true,582 "bumped_at": "2025-02-26T13:12:39.512Z",583 "archetype": "regular",584 "unseen": false,585 "pinned": false,586 "unpinned": null,587 "visible": true,588 "closed": false,589 "archived": false,590 "bookmarked": null,591 "liked": null,592 "tags_descriptions": {},593 "like_count": 0,594 "views": 44,595 "category_id": 1,596 "featured_link": null,597 "has_accepted_answer": false,598 "posters": [599 {600 "extras": "latest single",601 "description": "Original Poster, Most Recent Poster",602 "user": {603 "id": 5268,604 "username": "edmondj",605 "name": "Edmondja",606 "avatar_template": "/user_avatar/discuss.pytorch.org/edmondj/{size}/2779_2.png",607 "trust_level": 1608 }609 }610 ]611 }612 ],613 "tags_descriptions": {},614 "fancy_title": "CUDA error: device-side assert triggered in aws ec2",615 "id": 148994,616 "title": "CUDA error: device-side assert triggered in aws ec2",617 "posts_count": 5,618 "created_at": "2022-04-13T04:12:45.816Z",619 "views": 486,620 "reply_count": 2,621 "like_count": 1,622 "last_posted_at": "2022-04-18T06:33:27.021Z",623 "visible": true,624 "closed": false,625 "archived": false,626 "has_summary": false,627 "archetype": "regular",628 "slug": "cuda-error-device-side-assert-triggered-in-aws-ec2",629 "category_id": 1,630 "word_count": 576,631 "deleted_at": null,632 "user_id": 54957,633 "featured_link": null,634 "pinned_globally": false,635 "pinned_at": null,636 "pinned_until": null,637 "image_url": null,638 "slow_mode_seconds": 0,639 "draft": null,640 "draft_key": "topic_148994",641 "draft_sequence": null,642 "unpinned": null,643 "pinned": false,644 "current_post_number": 1,645 "highest_post_number": 5,646 "deleted_by": null,647 "actions_summary": [648 {649 "id": 4,650 "count": 0,651 "hidden": false,652 "can_act": false653 },654 {655 "id": 8,656 "count": 0,657 "hidden": false,658 "can_act": false659 },660 {661 "id": 10,662 "count": 0,663 "hidden": false,664 "can_act": false665 },666 {667 "id": 7,668 "count": 0,669 "hidden": false,670 "can_act": false671 }672 ],673 "chunk_size": 20,674 "bookmarked": false,675 "topic_timer": null,676 "message_bus_last_id": 0,677 "participant_count": 2,678 "show_read_indicator": false,679 "thumbnails": null,680 "slow_mode_enabled_until": null,681 "accepted_answer": {682 "post_number": 4,683 "username": "siddharth_MV",684 "name": "Siddharth MV",685 "excerpt": "I solved the error after struggling with it for a few days. I found out that there was an ‘.ipynb checkpoints’ file in the classes folder. So instead of 5 classes, there were 6. I deleted the file and the problem went away!"686 },687 "can_vote": false,688 "vote_count": 0,689 "user_voted": false,690 "discourse_zendesk_plugin_zendesk_id": null,691 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",692 "details": {693 "can_edit": false,694 "notification_level": 1,695 "participants": [696 {697 "id": 54957,698 "username": "siddharth_MV",699 "name": "Siddharth MV",700 "avatar_template": "/user_avatar/discuss.pytorch.org/siddharth_mv/{size}/48580_2.png",701 "post_count": 3,702 "primary_group_name": null,703 "flair_name": null,704 "flair_url": null,705 "flair_color": null,706 "flair_bg_color": null,707 "flair_group_id": null,708 "trust_level": 1709 },710 {711 "id": 3534,712 "username": "ptrblck",713 "name": "",714 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",715 "post_count": 2,716 "primary_group_name": null,717 "flair_name": null,718 "flair_url": null,719 "flair_color": null,720 "flair_bg_color": null,721 "flair_group_id": null,722 "admin": true,723 "moderator": true,724 "trust_level": 2725 }726 ],727 "created_by": {728 "id": 54957,729 "username": "siddharth_MV",730 "name": "Siddharth MV",731 "avatar_template": "/user_avatar/discuss.pytorch.org/siddharth_mv/{size}/48580_2.png"732 },733 "last_poster": {734 "id": 3534,735 "username": "ptrblck",736 "name": "",737 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"738 }739 },740 "bookmarks": []741 },742 {743 "post_stream": {744 "posts": [745 {746 "id": 61959,747 "name": "Vinay Kumar",748 "username": "vinaykumar2491",749 "avatar_template": "/user_avatar/discuss.pytorch.org/vinaykumar2491/{size}/44652_2.png",750 "created_at": "2018-08-21T12:15:52.155Z",751 "cooked": "<p><code>nn.Upsample()</code> is depecated in <code>pytorch version > 0.4.0</code> in favor of <code>nn.functional.interpolate()</code><br>\nI’m not able to use <code>interpolate()</code> inside <code>nn.Sequential()</code>:</p>\n<p>Below is my network:</p>\n<pre><code class=\"lang-auto\">class MeeDecoder(torch.nn.Module):\n def __init__(self):\n super(MeeDecoder, self).__init__()\n\n self.de_layer1 = torch.nn.Conv2d(in_channels=40, out_channels=30, kernel_size=(1,1), stride=1, bias=True)\n self.de_layer2 = torch.nn.Conv2d(in_channels=30, out_channels=20, kernel_size=(1,1), stride=1, bias=True)\n self.de_layer3 = torch.nn.functional.interpolate(size=(205, 5), mode='bilinear')\n self.de_layer4 = torch.nn.Conv2d(in_channels=20, out_channels=12, kernel_size=(3,3), stride=1, bias=True)\n self.de_layer5 = torch.nn.Upsample(size=(1025, 15), mode='bilinear')\n self.de_layer6 = torch.nn.Conv2d(in_channels=12, out_channels=1, kernel_size=(1,1), stride=1, bias=True)\n self.de_layerReLU = torch.nn.ReLU()\n\n self.decoder = torch.nn.Sequential(\n self.de_layer1,\n self.de_layerReLU,\n self.de_layer2,\n self.de_layerReLU,\n self.de_layer3,\n self.de_layer4,\n self.de_layerReLU,\n self.de_layer5,\n self.de_layer6,\n self.de_layerReLU\n )\n \n def forward(self, x):\n return self.decoder(x)\n</code></pre>\n<p>Any help.<br>\nThanks</p>",752 "post_number": 1,753 "post_type": 1,754 "posts_count": 8,755 "updated_at": "2018-08-21T12:37:56.155Z",756 "reply_count": 0,757 "reply_to_post_number": null,758 "quote_count": 0,759 "incoming_link_count": 11535,760 "reads": 576,761 "readers_count": 575,762 "score": 57790.2,763 "yours": false,764 "topic_id": 23588,765 "topic_slug": "using-nn-function-interpolate-inside-nn-sequential",766 "display_username": "Vinay Kumar",767 "primary_group_name": null,768 "flair_name": null,769 "flair_url": null,770 "flair_bg_color": null,771 "flair_color": null,772 "flair_group_id": null,773 "badges_granted": [],774 "version": 3,775 "can_edit": false,776 "can_delete": false,777 "can_recover": false,778 "can_see_hidden_post": false,779 "can_wiki": false,780 "read": true,781 "user_title": "",782 "bookmarked": false,783 "actions_summary": [784 {785 "id": 2,786 "count": 2787 }788 ],789 "moderator": false,790 "admin": false,791 "staff": false,792 "user_id": 9359,793 "hidden": false,794 "trust_level": 2,795 "deleted_at": null,796 "user_deleted": false,797 "edit_reason": null,798 "can_view_edit_history": true,799 "wiki": false,800 "post_url": "/t/using-nn-function-interpolate-inside-nn-sequential/23588/1",801 "can_accept_answer": false,802 "can_unaccept_answer": false,803 "accepted_answer": false,804 "topic_accepted_answer": true,805 "can_vote": false806 },807 {808 "id": 61965,809 "name": "",810 "username": "ptrblck",811 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",812 "created_at": "2018-08-21T12:26:43.360Z",813 "cooked": "<p>You could create a <code>nn.Module</code> with your <code>interpolate</code> function as a workaround:</p>\n<pre><code class=\"lang-python\">class Interpolate(nn.Module):\n def __init__(self, size, mode):\n super(Interpolate, self).__init__()\n self.interp = nn.functional.interpolate\n self.size = size\n self.mode = mode\n \n def forward(self, x):\n x = self.interp(x, size=self.size, mode=self.mode, align_corners=False)\n return x\n \n\nclass MeeDecoder(torch.nn.Module):\n def __init__(self):\n super(MeeDecoder, self).__init__()\n\n self.de_layer1 = torch.nn.Conv2d(in_channels=40, out_channels=30, kernel_size=(1,1), stride=1, bias=True)\n self.de_layer2 = torch.nn.Conv2d(in_channels=30, out_channels=20, kernel_size=(1,1), stride=1, bias=True)\n self.de_layer3 = Interpolate(size=(205, 5), mode='bilinear')\n self.de_layer4 = torch.nn.Conv2d(in_channels=20, out_channels=12, kernel_size=(3,3), stride=1, bias=True)\n self.de_layer5 = Interpolate(size=(1025, 15), mode='bilinear')\n self.de_layer6 = torch.nn.Conv2d(in_channels=12, out_channels=1, kernel_size=(1,1), stride=1, bias=True)\n self.de_layerReLU = torch.nn.ReLU()\n\n self.decoder = torch.nn.Sequential(\n self.de_layer1,\n self.de_layerReLU,\n self.de_layer2,\n self.de_layerReLU,\n self.de_layer3,\n self.de_layer4,\n self.de_layerReLU,\n self.de_layer5,\n self.de_layer6,\n self.de_layerReLU\n )\n \n def forward(self, x):\n return self.decoder(x)\n</code></pre>",814 "post_number": 2,815 "post_type": 1,816 "posts_count": 8,817 "updated_at": "2018-09-04T07:32:42.922Z",818 "reply_count": 3,819 "reply_to_post_number": null,820 "quote_count": 0,821 "incoming_link_count": 708,822 "reads": 546,823 "readers_count": 545,824 "score": 4048.2,825 "yours": false,826 "topic_id": 23588,827 "topic_slug": "using-nn-function-interpolate-inside-nn-sequential",828 "display_username": "",829 "primary_group_name": null,830 "flair_name": null,831 "flair_url": null,832 "flair_bg_color": null,833 "flair_color": null,834 "flair_group_id": null,835 "badges_granted": [],836 "version": 1,837 "can_edit": false,838 "can_delete": false,839 "can_recover": false,840 "can_see_hidden_post": false,841 "can_wiki": false,842 "link_counts": [843 {844 "url": "https://discuss.pytorch.org/t/which-function-is-better-for-upsampling-upsampling-or-interpolate/21811/8",845 "internal": true,846 "reflection": true,847 "title": "Which function is better for upsampling: upsampling or interpolate?",848 "clicks": 28849 }850 ],851 "read": true,852 "user_title": "",853 "bookmarked": false,854 "actions_summary": [855 {856 "id": 2,857 "count": 25858 }859 ],860 "moderator": true,861 "admin": true,862 "staff": true,863 "user_id": 3534,864 "hidden": false,865 "trust_level": 2,866 "deleted_at": null,867 "user_deleted": false,868 "edit_reason": null,869 "can_view_edit_history": true,870 "wiki": false,871 "post_url": "/t/using-nn-function-interpolate-inside-nn-sequential/23588/2",872 "can_accept_answer": false,873 "can_unaccept_answer": false,874 "accepted_answer": true,875 "topic_accepted_answer": true876 },877 {878 "id": 64272,879 "name": "Vinay Kumar",880 "username": "vinaykumar2491",881 "avatar_template": "/user_avatar/discuss.pytorch.org/vinaykumar2491/{size}/44652_2.png",882 "created_at": "2018-09-04T07:33:14.368Z",883 "cooked": "<p>Thank you <a class=\"mention\" href=\"/u/ptrblck\">@ptrblck</a>. It works. <img src=\"https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6\" title=\":slight_smile:\" class=\"emoji\" alt=\":slight_smile:\"></p>",884 "post_number": 3,885 "post_type": 1,886 "posts_count": 8,887 "updated_at": "2018-09-04T07:33:14.368Z",888 "reply_count": 0,889 "reply_to_post_number": 2,890 "quote_count": 0,891 "incoming_link_count": 26,892 "reads": 426,893 "readers_count": 425,894 "score": 215.2,895 "yours": false,896 "topic_id": 23588,897 "topic_slug": "using-nn-function-interpolate-inside-nn-sequential",898 "display_username": "Vinay Kumar",899 "primary_group_name": null,900 "flair_name": null,901 "flair_url": null,902 "flair_bg_color": null,903 "flair_color": null,904 "flair_group_id": null,905 "badges_granted": [],906 "version": 1,907 "can_edit": false,908 "can_delete": false,909 "can_recover": false,910 "can_see_hidden_post": false,911 "can_wiki": false,912 "read": true,913 "user_title": "",914 "reply_to_user": {915 "id": 3534,916 "username": "ptrblck",917 "name": "",918 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"919 },920 "bookmarked": false,921 "actions_summary": [],922 "moderator": false,923 "admin": false,924 "staff": false,925 "user_id": 9359,926 "hidden": false,927 "trust_level": 2,928 "deleted_at": null,929 "user_deleted": false,930 "edit_reason": null,931 "can_view_edit_history": true,932 "wiki": false,933 "post_url": "/t/using-nn-function-interpolate-inside-nn-sequential/23588/3",934 "can_accept_answer": false,935 "can_unaccept_answer": false,936 "accepted_answer": false,937 "topic_accepted_answer": true938 },939 {940 "id": 73690,941 "name": "Rchavezj",942 "username": "rchavezj",943 "avatar_template": "/user_avatar/discuss.pytorch.org/rchavezj/{size}/16902_2.png",944 "created_at": "2018-11-01T21:16:18.197Z",945 "cooked": "<p>Why provide align_corners as an additional argument for Interpolate class may I ask? It wasn’t a passing argument for the deprecated upsampling.</p>",946 "post_number": 4,947 "post_type": 1,948 "posts_count": 8,949 "updated_at": "2018-11-01T21:16:18.197Z",950 "reply_count": 1,951 "reply_to_post_number": 2,952 "quote_count": 0,953 "incoming_link_count": 27,954 "reads": 357,955 "readers_count": 356,956 "score": 226.4,957 "yours": false,958 "topic_id": 23588,959 "topic_slug": "using-nn-function-interpolate-inside-nn-sequential",960 "display_username": "Rchavezj",961 "primary_group_name": null,962 "flair_name": null,963 "flair_url": null,964 "flair_bg_color": null,965 "flair_color": null,966 "flair_group_id": null,967 "badges_granted": [],968 "version": 1,969 "can_edit": false,970 "can_delete": false,971 "can_recover": false,972 "can_see_hidden_post": false,973 "can_wiki": false,974 "read": true,975 "user_title": "",976 "reply_to_user": {977 "id": 3534,978 "username": "ptrblck",979 "name": "",980 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"981 },982 "bookmarked": false,983 "actions_summary": [984 {985 "id": 2,986 "count": 1987 }988 ],989 "moderator": false,990 "admin": false,991 "staff": false,992 "user_id": 8830,993 "hidden": false,994 "trust_level": 2,995 "deleted_at": null,996 "user_deleted": false,997 "edit_reason": null,998 "can_view_edit_history": true,999 "wiki": false,1000 "post_url": "/t/using-nn-function-interpolate-inside-nn-sequential/23588/4",1001 "can_accept_answer": false,1002 "can_unaccept_answer": false,1003 "accepted_answer": false,1004 "topic_accepted_answer": true1005 },1006 {1007 "id": 159421,1008 "name": "Vijay",1009 "username": "Vijay",1010 "avatar_template": "/user_avatar/discuss.pytorch.org/vijay/{size}/19256_2.png",1011 "created_at": "2020-01-17T22:43:12.690Z",1012 "cooked": "<p>You doesn’t specify input</p>",1013 "post_number": 5,1014 "post_type": 1,1015 "posts_count": 8,1016 "updated_at": "2020-01-17T22:43:12.690Z",1017 "reply_count": 0,1018 "reply_to_post_number": null,1019 "quote_count": 0,1020 "incoming_link_count": 5,1021 "reads": 146,1022 "readers_count": 145,1023 "score": 69.2,1024 "yours": false,1025 "topic_id": 23588,1026 "topic_slug": "using-nn-function-interpolate-inside-nn-sequential",1027 "display_username": "Vijay",1028 "primary_group_name": null,1029 "flair_name": null,1030 "flair_url": null,1031 "flair_bg_color": null,1032 "flair_color": null,1033 "flair_group_id": null,1034 "badges_granted": [],1035 "version": 1,1036 "can_edit": false,1037 "can_delete": false,1038 "can_recover": false,1039 "can_see_hidden_post": false,1040 "can_wiki": false,1041 "read": true,1042 "user_title": null,1043 "bookmarked": false,1044 "actions_summary": [1045 {1046 "id": 2,1047 "count": 11048 }1049 ],1050 "moderator": false,1051 "admin": false,1052 "staff": false,1053 "user_id": 26096,1054 "hidden": false,1055 "trust_level": 1,1056 "deleted_at": null,1057 "user_deleted": false,1058 "edit_reason": null,1059 "can_view_edit_history": true,1060 "wiki": false,1061 "post_url": "/t/using-nn-function-interpolate-inside-nn-sequential/23588/5",1062 "can_accept_answer": false,1063 "can_unaccept_answer": false,1064 "accepted_answer": false,1065 "topic_accepted_answer": true1066 },1067 {1068 "id": 245371,1069 "name": "degawong",1070 "username": "degawong",1071 "avatar_template": "/user_avatar/discuss.pytorch.org/degawong/{size}/31229_2.png",1072 "created_at": "2020-11-19T09:49:32.217Z",1073 "cooked": "<p>the two functions were designed for different cases.obviously, the interpolate class has more wide range of application scenarios.</p>",1074 "post_number": 6,1075 "post_type": 1,1076 "posts_count": 8,1077 "updated_at": "2020-11-19T09:49:32.217Z",1078 "reply_count": 0,1079 "reply_to_post_number": 4,1080 "quote_count": 0,1081 "incoming_link_count": 6,1082 "reads": 81,1083 "readers_count": 80,1084 "score": 61.2,1085 "yours": false,1086 "topic_id": 23588,1087 "topic_slug": "using-nn-function-interpolate-inside-nn-sequential",1088 "display_username": "degawong",1089 "primary_group_name": null,1090 "flair_name": null,1091 "flair_url": null,1092 "flair_bg_color": null,1093 "flair_color": null,1094 "flair_group_id": null,1095 "badges_granted": [],1096 "version": 1,1097 "can_edit": false,1098 "can_delete": false,1099 "can_recover": false,1100 "can_see_hidden_post": false,1101 "can_wiki": false,1102 "read": true,1103 "user_title": null,1104 "reply_to_user": {1105 "id": 8830,1106 "username": "rchavezj",1107 "name": "Rchavezj",1108 "avatar_template": "/user_avatar/discuss.pytorch.org/rchavezj/{size}/16902_2.png"1109 },1110 "bookmarked": false,1111 "actions_summary": [1112 {1113 "id": 2,1114 "count": 11115 }1116 ],1117 "moderator": false,1118 "admin": false,1119 "staff": false,1120 "user_id": 39089,1121 "hidden": false,1122 "trust_level": 1,1123 "deleted_at": null,1124 "user_deleted": false,1125 "edit_reason": null,1126 "can_view_edit_history": true,1127 "wiki": false,1128 "post_url": "/t/using-nn-function-interpolate-inside-nn-sequential/23588/6",1129 "can_accept_answer": false,1130 "can_unaccept_answer": false,1131 "accepted_answer": false,1132 "topic_accepted_answer": true1133 },1134 {1135 "id": 341948,1136 "name": "AM.MO",1137 "username": "AM.MO",1138 "avatar_template": "/user_avatar/discuss.pytorch.org/am.mo/{size}/32442_2.png",1139 "created_at": "2022-04-18T05:39:14.685Z",1140 "cooked": "<p>could you pls tell me how can I calculate the size of the “interpolate”??</p>",1141 "post_number": 7,1142 "post_type": 1,1143 "posts_count": 8,1144 "updated_at": "2022-04-18T05:39:14.685Z",1145 "reply_count": 1,1146 "reply_to_post_number": 2,1147 "quote_count": 0,1148 "incoming_link_count": 5,1149 "reads": 28,1150 "readers_count": 27,1151 "score": 35.6,1152 "yours": false,1153 "topic_id": 23588,1154 "topic_slug": "using-nn-function-interpolate-inside-nn-sequential",1155 "display_username": "AM.MO",1156 "primary_group_name": null,1157 "flair_name": null,1158 "flair_url": null,1159 "flair_bg_color": null,1160 "flair_color": null,1161 "flair_group_id": null,1162 "badges_granted": [],1163 "version": 1,1164 "can_edit": false,1165 "can_delete": false,1166 "can_recover": false,1167 "can_see_hidden_post": false,1168 "can_wiki": false,1169 "read": true,1170 "user_title": null,1171 "reply_to_user": {1172 "id": 3534,1173 "username": "ptrblck",1174 "name": "",1175 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"1176 },1177 "bookmarked": false,1178 "actions_summary": [],1179 "moderator": false,1180 "admin": false,1181 "staff": false,1182 "user_id": 47864,1183 "hidden": false,1184 "trust_level": 1,1185 "deleted_at": null,1186 "user_deleted": false,1187 "edit_reason": null,1188 "can_view_edit_history": true,1189 "wiki": false,1190 "post_url": "/t/using-nn-function-interpolate-inside-nn-sequential/23588/7",1191 "can_accept_answer": false,1192 "can_unaccept_answer": false,1193 "accepted_answer": false,1194 "topic_accepted_answer": true1195 },1196 {1197 "id": 341964,1198 "name": "",1199 "username": "ptrblck",1200 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",