Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 216978,7 "name": "yihe Young",8 "username": "yihe_Young",9 "avatar_template": "/user_avatar/discuss.pytorch.org/yihe_young/{size}/27306_2.png",10 "created_at": "2020-07-30T13:51:32.854Z",11 "cooked": "<p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://discuss.pytorch.org/uploads/default/original/3X/8/9/89e02bb60faf7718525ee65024301e50875acea3.png\" data-download-href=\"https://discuss.pytorch.org/uploads/default/89e02bb60faf7718525ee65024301e50875acea3\" title=\"TIM截图20200730214049\"><img src=\"https://discuss.pytorch.org/uploads/default/original/3X/8/9/89e02bb60faf7718525ee65024301e50875acea3.png\" alt=\"TIM截图20200730214049\" data-base62-sha1=\"jFHHdvgn8uf5L2eoodn3AYLqSYz\" width=\"652\" height=\"500\" data-dominant-color=\"F3F4F4\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">TIM截图20200730214049</span><span class=\"informations\">960×736 22.6 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div><br>\nI want to apply multiprocessing on some simple cuda-related problem as above(Jupyter Notebook). It ought to print out the tensor if everything goes well. However, nothing happens(even without any errors…) after running out all cells. And the ‘traditional’ method-----‘set_start_method(‘spawn’)’ didn’t help… I’m pretty eager to figure out the real problem.</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 1,15 "updated_at": "2020-07-30T13:51:32.854Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 14,20 "reads": 3,21 "readers_count": 2,22 "score": 70.6,23 "yours": false,24 "topic_id": 91109,25 "topic_slug": "how-to-apply-multiprocessing-with-cuda",26 "display_username": "yihe Young",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://discuss.pytorch.org/uploads/default/original/3X/8/9/89e02bb60faf7718525ee65024301e50875acea3.png",43 "internal": true,44 "reflection": false,45 "clicks": 046 }47 ],48 "read": true,49 "user_title": null,50 "bookmarked": false,51 "actions_summary": [],52 "moderator": false,53 "admin": false,54 "staff": false,55 "user_id": 34969,56 "hidden": false,57 "trust_level": 0,58 "deleted_at": null,59 "user_deleted": false,60 "edit_reason": null,61 "can_view_edit_history": true,62 "wiki": false,63 "post_url": "/t/how-to-apply-multiprocessing-with-cuda/91109/1",64 "can_accept_answer": false,65 "can_unaccept_answer": false,66 "accepted_answer": false,67 "topic_accepted_answer": null,68 "can_vote": false69 }70 ],71 "stream": [72 21697873 ]74 },75 "timeline_lookup": [76 [77 1,78 191379 ]80 ],81 "suggested_topics": [82 {83 "fancy_title": "Size mismatch for model",84 "id": 212435,85 "title": "Size mismatch for model",86 "slug": "size-mismatch-for-model",87 "posts_count": 2,88 "reply_count": 0,89 "highest_post_number": 2,90 "image_url": null,91 "created_at": "2024-11-02T01:18:21.033Z",92 "last_posted_at": "2024-11-02T18:14:42.220Z",93 "bumped": true,94 "bumped_at": "2024-11-02T18:14:42.220Z",95 "archetype": "regular",96 "unseen": false,97 "pinned": false,98 "unpinned": null,99 "visible": true,100 "closed": false,101 "archived": false,102 "bookmarked": null,103 "liked": null,104 "tags_descriptions": {},105 "like_count": 0,106 "views": 817,107 "category_id": 1,108 "featured_link": null,109 "has_accepted_answer": false,110 "posters": [111 {112 "extras": null,113 "description": "Original Poster",114 "user": {115 "id": 80643,116 "username": "Andile_Zungu",117 "name": "Andile Zungu",118 "avatar_template": "/user_avatar/discuss.pytorch.org/andile_zungu/{size}/73200_2.png",119 "trust_level": 0120 }121 },122 {123 "extras": "latest",124 "description": "Most Recent Poster",125 "user": {126 "id": 3534,127 "username": "ptrblck",128 "name": "",129 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",130 "admin": true,131 "moderator": true,132 "trust_level": 2133 }134 }135 ]136 },137 {138 "fancy_title": "Best way to find a specific tensor within a model",139 "id": 214277,140 "title": "Best way to find a specific tensor within a model",141 "slug": "best-way-to-find-a-specific-tensor-within-a-model",142 "posts_count": 5,143 "reply_count": 2,144 "highest_post_number": 5,145 "image_url": null,146 "created_at": "2024-12-16T15:35:30.104Z",147 "last_posted_at": "2024-12-16T16:49:25.910Z",148 "bumped": true,149 "bumped_at": "2024-12-16T16:49:25.910Z",150 "archetype": "regular",151 "unseen": false,152 "pinned": false,153 "unpinned": null,154 "visible": true,155 "closed": false,156 "archived": false,157 "bookmarked": null,158 "liked": null,159 "tags_descriptions": {},160 "like_count": 2,161 "views": 59,162 "category_id": 1,163 "featured_link": null,164 "has_accepted_answer": true,165 "posters": [166 {167 "extras": "latest",168 "description": "Original Poster, Most Recent Poster, Accepted Answer",169 "user": {170 "id": 6296,171 "username": "pytorcher",172 "name": "",173 "avatar_template": "/letter_avatar_proxy/v4/letter/p/7ea924/{size}.png",174 "trust_level": 1175 }176 },177 {178 "extras": null,179 "description": "Frequent Poster",180 "user": {181 "id": 211,182 "username": "albanD",183 "name": "Alban D",184 "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",185 "admin": true,186 "moderator": true,187 "trust_level": 4188 }189 }190 ]191 },192 {193 "fancy_title": "Lipschitz Constant of Conv2d",194 "id": 218943,195 "title": "Lipschitz Constant of Conv2d",196 "slug": "lipschitz-constant-of-conv2d",197 "posts_count": 1,198 "reply_count": 0,199 "highest_post_number": 1,200 "image_url": null,201 "created_at": "2025-04-10T10:50:22.705Z",202 "last_posted_at": "2025-04-10T10:50:22.744Z",203 "bumped": true,204 "bumped_at": "2025-04-10T10:50:22.744Z",205 "archetype": "regular",206 "unseen": false,207 "pinned": false,208 "unpinned": null,209 "visible": true,210 "closed": false,211 "archived": false,212 "bookmarked": null,213 "liked": null,214 "tags_descriptions": {},215 "like_count": 0,216 "views": 55,217 "category_id": 1,218 "featured_link": null,219 "has_accepted_answer": false,220 "posters": [221 {222 "extras": "latest single",223 "description": "Original Poster, Most Recent Poster",224 "user": {225 "id": 83742,226 "username": "Sherlock_Holmes",227 "name": "",228 "avatar_template": "/user_avatar/discuss.pytorch.org/sherlock_holmes/{size}/74585_2.png",229 "trust_level": 0230 }231 }232 ]233 },234 {235 "fancy_title": "Find maximum length of consecutive zeros in each row",236 "id": 213871,237 "title": "Find maximum length of consecutive zeros in each row",238 "slug": "find-maximum-length-of-consecutive-zeros-in-each-row",239 "posts_count": 3,240 "reply_count": 0,241 "highest_post_number": 3,242 "image_url": null,243 "created_at": "2024-12-05T16:46:38.153Z",244 "last_posted_at": "2024-12-08T19:58:20.444Z",245 "bumped": true,246 "bumped_at": "2024-12-08T19:58:20.444Z",247 "archetype": "regular",248 "unseen": false,249 "pinned": false,250 "unpinned": null,251 "visible": true,252 "closed": false,253 "archived": false,254 "bookmarked": null,255 "liked": null,256 "tags_descriptions": {},257 "like_count": 0,258 "views": 215,259 "category_id": 1,260 "featured_link": null,261 "has_accepted_answer": false,262 "posters": [263 {264 "extras": null,265 "description": "Original Poster",266 "user": {267 "id": 81339,268 "username": "Paulo_Nascimento",269 "name": "Paulo Nascimento",270 "avatar_template": "/user_avatar/discuss.pytorch.org/paulo_nascimento/{size}/72888_2.png",271 "trust_level": 0272 }273 },274 {275 "extras": null,276 "description": "Frequent Poster",277 "user": {278 "id": 72430,279 "username": "Eduardo_Lawson",280 "name": "Eduardo Lawson da Silva",281 "avatar_template": "/user_avatar/discuss.pytorch.org/eduardo_lawson/{size}/66899_2.png",282 "trust_level": 2283 }284 },285 {286 "extras": "latest",287 "description": "Most Recent Poster",288 "user": {289 "id": 18088,290 "username": "KFrank",291 "name": "K. Frank",292 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",293 "trust_level": 2294 }295 }296 ]297 },298 {299 "fancy_title": "Use Pytorch NN as optimiser: freeze weights and optimise over input",300 "id": 219928,301 "title": "Use Pytorch NN as optimiser: freeze weights and optimise over input",302 "slug": "use-pytorch-nn-as-optimiser-freeze-weights-and-optimise-over-input",303 "posts_count": 3,304 "reply_count": 1,305 "highest_post_number": 3,306 "image_url": null,307 "created_at": "2025-05-10T17:29:04.688Z",308 "last_posted_at": "2025-05-24T10:13:17.510Z",309 "bumped": true,310 "bumped_at": "2025-05-24T10:13:17.510Z",311 "archetype": "regular",312 "unseen": false,313 "pinned": false,314 "unpinned": null,315 "visible": true,316 "closed": false,317 "archived": false,318 "bookmarked": null,319 "liked": null,320 "tags_descriptions": {},321 "like_count": 0,322 "views": 136,323 "category_id": 1,324 "featured_link": null,325 "has_accepted_answer": false,326 "posters": [327 {328 "extras": "latest",329 "description": "Original Poster, Most Recent Poster",330 "user": {331 "id": 84228,332 "username": "Michael3",333 "name": "",334 "avatar_template": "/letter_avatar_proxy/v4/letter/m/ecccb3/{size}.png",335 "trust_level": 1336 }337 },338 {339 "extras": null,340 "description": "Frequent Poster",341 "user": {342 "id": 18088,343 "username": "KFrank",344 "name": "K. Frank",345 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",346 "trust_level": 2347 }348 }349 ]350 }351 ],352 "tags_descriptions": {},353 "fancy_title": "How to apply multiprocessing with cuda?",354 "id": 91109,355 "title": "How to apply multiprocessing with cuda?",356 "posts_count": 1,357 "created_at": "2020-07-30T13:51:32.805Z",358 "views": 469,359 "reply_count": 0,360 "like_count": 0,361 "last_posted_at": "2020-07-30T13:51:32.854Z",362 "visible": true,363 "closed": false,364 "archived": false,365 "has_summary": false,366 "archetype": "regular",367 "slug": "how-to-apply-multiprocessing-with-cuda",368 "category_id": 1,369 "word_count": 62,370 "deleted_at": null,371 "user_id": 34969,372 "featured_link": null,373 "pinned_globally": false,374 "pinned_at": null,375 "pinned_until": null,376 "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/8/9/89e02bb60faf7718525ee65024301e50875acea3.png",377 "slow_mode_seconds": 0,378 "draft": null,379 "draft_key": "topic_91109",380 "draft_sequence": null,381 "unpinned": null,382 "pinned": false,383 "current_post_number": 1,384 "highest_post_number": 1,385 "deleted_by": null,386 "actions_summary": [387 {388 "id": 4,389 "count": 0,390 "hidden": false,391 "can_act": false392 },393 {394 "id": 8,395 "count": 0,396 "hidden": false,397 "can_act": false398 },399 {400 "id": 10,401 "count": 0,402 "hidden": false,403 "can_act": false404 },405 {406 "id": 7,407 "count": 0,408 "hidden": false,409 "can_act": false410 }411 ],412 "chunk_size": 20,413 "bookmarked": false,414 "topic_timer": null,415 "message_bus_last_id": 0,416 "participant_count": 1,417 "show_read_indicator": false,418 "thumbnails": [419 {420 "max_width": null,421 "max_height": null,422 "width": 960,423 "height": 736,424 "url": "https://discuss.pytorch.org/uploads/default/original/3X/8/9/89e02bb60faf7718525ee65024301e50875acea3.png"425 }426 ],427 "slow_mode_enabled_until": null,428 "can_vote": false,429 "vote_count": 0,430 "user_voted": false,431 "discourse_zendesk_plugin_zendesk_id": null,432 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",433 "details": {434 "can_edit": false,435 "notification_level": 1,436 "participants": [437 {438 "id": 34969,439 "username": "yihe_Young",440 "name": "yihe Young",441 "avatar_template": "/user_avatar/discuss.pytorch.org/yihe_young/{size}/27306_2.png",442 "post_count": 1,443 "primary_group_name": null,444 "flair_name": null,445 "flair_url": null,446 "flair_color": null,447 "flair_bg_color": null,448 "flair_group_id": null,449 "trust_level": 0450 }451 ],452 "created_by": {453 "id": 34969,454 "username": "yihe_Young",455 "name": "yihe Young",456 "avatar_template": "/user_avatar/discuss.pytorch.org/yihe_young/{size}/27306_2.png"457 },458 "last_poster": {459 "id": 34969,460 "username": "yihe_Young",461 "name": "yihe Young",462 "avatar_template": "/user_avatar/discuss.pytorch.org/yihe_young/{size}/27306_2.png"463 }464 },465 "bookmarks": []466 },467 {468 "post_stream": {469 "posts": [470 {471 "id": 211268,472 "name": "Wai Tik Chan",473 "username": "Wai_Tik_Chan",474 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png",475 "created_at": "2020-07-11T14:30:22.623Z",476 "cooked": "<p>Hi there,</p>\n<p>Good days everyone, I am trying on a network with input shape of 6x224x224 tensor, however, the torch.summary() report that the input size is around 86436.00 MB which is 84GB , so that it is killed.<br>\nI have google around on how is the input size calculated but it didn’t match with the output shows.<br>\nIs there any thing wrong in my code ?<br>\nThanks ~~</p>\n<p>Dick</p>\n<p>Here is the output of torch.summary()</p>\n<hr>\n<pre><code> Layer (type) Output Shape Param #\n</code></pre>\n<h1>================================================================<br>\nConv2d-1 [-1, 64, 224, 224] 3,520<br>\nReLU-2 [-1, 64, 224, 224] 0<br>\nConv2d-3 [-1, 64, 224, 224] 36,928<br>\nReLU-4 [-1, 64, 224, 224] 0<br>\nMaxPool2d-5 [-1, 64, 112, 112] 0<br>\nConv2d-6 [-1, 128, 112, 112] 73,856<br>\nReLU-7 [-1, 128, 112, 112] 0<br>\nConv2d-8 [-1, 128, 112, 112] 147,584<br>\nReLU-9 [-1, 128, 112, 112] 0<br>\nMaxPool2d-10 [-1, 128, 56, 56] 0<br>\nConv2d-11 [-1, 256, 56, 56] 295,168<br>\nReLU-12 [-1, 256, 56, 56] 0<br>\nConv2d-13 [-1, 256, 56, 56] 590,080<br>\nReLU-14 [-1, 256, 56, 56] 0<br>\nMaxPool2d-15 [-1, 256, 28, 28] 0<br>\nConv2d-16 [-1, 512, 28, 28] 1,180,160<br>\nReLU-17 [-1, 512, 28, 28] 0<br>\nConv2d-18 [-1, 512, 28, 28] 2,359,808<br>\nReLU-19 [-1, 512, 28, 28] 0<br>\nConv2d-20 [-1, 512, 28, 28] 2,359,808<br>\nReLU-21 [-1, 512, 28, 28] 0<br>\nMaxPool2d-22 [-1, 512, 14, 14] 0<br>\nConv2d-23 [-1, 512, 14, 14] 2,359,808<br>\nReLU-24 [-1, 512, 14, 14] 0<br>\nConv2d-25 [-1, 512, 14, 14] 2,359,808<br>\nReLU-26 [-1, 512, 14, 14] 0<br>\nConv2d-27 [-1, 512, 14, 14] 2,359,808<br>\nReLU-28 [-1, 512, 14, 14] 0<br>\nMaxPool2d-29 [-1, 512, 7, 7] 0<br>\nLinear-30 [-1, 4096] 102,764,544<br>\nReLU-31 [-1, 4096] 0<br>\nLinear-32 [-1, 4096] 16,781,312<br>\nReLU-33 [-1, 4096] 0<br>\nLinear-34 [-1, 1] 4,097</h1>\n<h2>Total params: 133,676,289<br>\nTrainable params: 133,676,289<br>\nNon-trainable params: 0</h2>\n<h2>Input size (MB): 86436.00<br>\nForward/backward pass size (MB): 206.27<br>\nParams size (MB): 509.93<br>\nEstimated Total Size (MB): 87152.20</h2>\n<p>Here is the forward code, I have use cat to stack up 2 image to 6 channel<br>\n```<br>\ndef forward(self,leftimage,rightimage):<br>\ncombine=torch.cat((leftimage,rightimage),1)<br>\ncombine=self.encoder(combine)<br>\n#combine=self.encoder(leftimage)</p>\n<pre><code> #print(combine.shape)\n combine=torch.flatten(combine,1)\n #print(combine.shape)\n combine=self.classifier(combine)\n return combine\n</code></pre>\n<pre><code class=\"lang-auto\"></code></pre>",477 "post_number": 1,478 "post_type": 1,479 "posts_count": 6,480 "updated_at": "2020-07-11T14:30:22.623Z",481 "reply_count": 0,482 "reply_to_post_number": null,483 "quote_count": 0,484 "incoming_link_count": 563,485 "reads": 15,486 "readers_count": 14,487 "score": 2818.0,488 "yours": false,489 "topic_id": 88805,490 "topic_slug": "input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb",491 "display_username": "Wai Tik Chan",492 "primary_group_name": null,493 "flair_name": null,494 "flair_url": null,495 "flair_bg_color": null,496 "flair_color": null,497 "flair_group_id": null,498 "badges_granted": [],499 "version": 1,500 "can_edit": false,501 "can_delete": false,502 "can_recover": false,503 "can_see_hidden_post": false,504 "can_wiki": false,505 "read": true,506 "user_title": null,507 "bookmarked": false,508 "actions_summary": [],509 "moderator": false,510 "admin": false,511 "staff": false,512 "user_id": 34029,513 "hidden": false,514 "trust_level": 1,515 "deleted_at": null,516 "user_deleted": false,517 "edit_reason": null,518 "can_view_edit_history": true,519 "wiki": false,520 "post_url": "/t/input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb/88805/1",521 "can_accept_answer": false,522 "can_unaccept_answer": false,523 "accepted_answer": false,524 "topic_accepted_answer": null,525 "can_vote": false526 },527 {528 "id": 211274,529 "name": "Juan Montesinos",530 "username": "JuanFMontesinos",531 "avatar_template": "/user_avatar/discuss.pytorch.org/juanfmontesinos/{size}/76115_2.png",532 "created_at": "2020-07-11T15:32:33.581Z",533 "cooked": "<p>what is your batch size? that’s prob the problem</p>",534 "post_number": 2,535 "post_type": 1,536 "posts_count": 6,537 "updated_at": "2020-07-11T15:32:33.581Z",538 "reply_count": 1,539 "reply_to_post_number": null,540 "quote_count": 0,541 "incoming_link_count": 1,542 "reads": 14,543 "readers_count": 13,544 "score": 12.8,545 "yours": false,546 "topic_id": 88805,547 "topic_slug": "input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb",548 "display_username": "Juan Montesinos",549 "primary_group_name": null,550 "flair_name": null,551 "flair_url": null,552 "flair_bg_color": null,553 "flair_color": null,554 "flair_group_id": null,555 "badges_granted": [],556 "version": 1,557 "can_edit": false,558 "can_delete": false,559 "can_recover": false,560 "can_see_hidden_post": false,561 "can_wiki": false,562 "read": true,563 "user_title": "",564 "bookmarked": false,565 "actions_summary": [],566 "moderator": false,567 "admin": false,568 "staff": false,569 "user_id": 9081,570 "hidden": false,571 "trust_level": 2,572 "deleted_at": null,573 "user_deleted": false,574 "edit_reason": null,575 "can_view_edit_history": true,576 "wiki": false,577 "post_url": "/t/input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb/88805/2",578 "can_accept_answer": false,579 "can_unaccept_answer": false,580 "accepted_answer": false,581 "topic_accepted_answer": null582 },583 {584 "id": 211585,585 "name": "Wai Tik Chan",586 "username": "Wai_Tik_Chan",587 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png",588 "created_at": "2020-07-13T02:11:48.440Z",589 "cooked": "<p>HI Juan ,</p>\n<p>Thanks for your reply. The batch size is 2 which means 4 images(3x224x224) to be load in batch.<br>\nI have try to the following config on the model :</p>\n<ol>\n<li>3 channel -> 0.57MB (3x244x224)</li>\n<li>4 channel -> 3.8GB (2x224x224 , 2x224x224)</li>\n</ol>\n<p>Here is the code for the model :</p>\n<pre><code class=\"lang-auto\">class Vgg16PairInput(nn.Module):\n \n def weight_init(self,m):\n classname=m.__class__.__name__\n if classname.find('ConvTran')!=-1:\n m.weight.data.normal_(1,0.5)\n \n def __init__(self):\n super(Vgg16PairInput,self).__init__()\n #self.pretrained_model = models.vgg16(pretrained=True)\n #self.pretrained_model = models.vgg16(pretrained=True)\n self.encoder = nn.Sequential(\n nn.Conv2d(6,64,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(64),\n nn.ReLU(),\n nn.Conv2d(64,64,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(64),\n nn.ReLU(),\n nn.MaxPool2d(kernel_size=2, stride=2), #128 112\n nn.Conv2d(64,128,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(128),\n nn.ReLU(),\n nn.Conv2d(128,128,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(128),\n nn.ReLU(),\n nn.MaxPool2d(kernel_size=2, stride=2), #64 56\n nn.Conv2d(128,256,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(256),\n nn.ReLU(),\n nn.Conv2d(256,256,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(256),\n nn.ReLU(),\n nn.MaxPool2d(kernel_size=2, stride=2), #32 28\n nn.Conv2d(256,512,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.Conv2d(512,512,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.Conv2d(512,512,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.MaxPool2d(kernel_size=2, stride=2), #16 14\n nn.Conv2d(512,512,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.Conv2d(512,512,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.Conv2d(512,512,kernel_size=3,stride=1,padding=1),\n #nn.BatchNorm2d(512),\n nn.ReLU(),\n nn.MaxPool2d(kernel_size=2, stride=2), #8 7 \n \n )\n \n \n self.classifier=nn.Sequential(\n nn.Linear(7*7*512,4096),\n nn.ReLU(),\n nn.Linear(4096,4096),\n nn.ReLU(),\n nn.Linear(4096,1)\n )\n \n #del self.pretrained_model\n #self.encoder.apply(self.weight_init)\n \n \n def encode(self,images):\n code=self.encoder(images)\n return code\n \n \n \n def forward(self,leftimage,rightimage):\n combine=torch.cat((leftimage,rightimage),1)\n combine=self.encoder(combine)\n #combine=self.encoder(leftimage)\n \n #print(combine.shape)\n combine=torch.flatten(combine,1)\n #print(combine.shape)\n combine=self.classifier(combine)\n return combine\n</code></pre>\n<p>Thanks,<br>\nDick</p>",590 "post_number": 3,591 "post_type": 1,592 "posts_count": 6,593 "updated_at": "2020-07-13T02:11:48.440Z",594 "reply_count": 1,595 "reply_to_post_number": 2,596 "quote_count": 0,597 "incoming_link_count": 10,598 "reads": 13,599 "readers_count": 12,600 "score": 57.6,601 "yours": false,602 "topic_id": 88805,603 "topic_slug": "input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb",604 "display_username": "Wai Tik Chan",605 "primary_group_name": null,606 "flair_name": null,607 "flair_url": null,608 "flair_bg_color": null,609 "flair_color": null,610 "flair_group_id": null,611 "badges_granted": [],612 "version": 1,613 "can_edit": false,614 "can_delete": false,615 "can_recover": false,616 "can_see_hidden_post": false,617 "can_wiki": false,618 "read": true,619 "user_title": null,620 "reply_to_user": {621 "id": 9081,622 "username": "JuanFMontesinos",623 "name": "Juan Montesinos",624 "avatar_template": "/user_avatar/discuss.pytorch.org/juanfmontesinos/{size}/76115_2.png"625 },626 "bookmarked": false,627 "actions_summary": [],628 "moderator": false,629 "admin": false,630 "staff": false,631 "user_id": 34029,632 "hidden": false,633 "trust_level": 1,634 "deleted_at": null,635 "user_deleted": false,636 "edit_reason": null,637 "can_view_edit_history": true,638 "wiki": false,639 "post_url": "/t/input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb/88805/3",640 "can_accept_answer": false,641 "can_unaccept_answer": false,642 "accepted_answer": false,643 "topic_accepted_answer": null644 },645 {646 "id": 211630,647 "name": "Wai Tik Chan",648 "username": "Wai_Tik_Chan",649 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png",650 "created_at": "2020-07-13T05:08:37.319Z",651 "cooked": "<p>Hi All,</p>\n<p>I have check out on the pytorch-summary source code and find the input size is calculate as follow :</p>\n<pre><code class=\"lang-auto\"> # assume 4 bytes/number (float on cuda).\ntotal_input_size = abs(np.prod(sum(input_size, ()))\n * batch_size * 4. / (1024 ** 2.))\n</code></pre>\n<p>The 8GB memory seems like it will multiply those 2 tensors shape together :<br>\n224 * 224 * 3 * 224 * 224 * 3<br>\nThen *4 = 90634715136 / (1024^2) = 86436<br>\nwhich match the display.<br>\nSo I misunderstand that it would get the input size by following the forward function.</p>\n<p>To consider in my case , the input size of the model should be (224 * 244 * 6 * 4)/(1024^2) = 1.148MB ?</p>\n<p>Thanks,<br>\nDick</p>",652 "post_number": 4,653 "post_type": 1,654 "posts_count": 6,655 "updated_at": "2020-07-13T05:22:28.301Z",656 "reply_count": 1,657 "reply_to_post_number": 3,658 "quote_count": 0,659 "incoming_link_count": 9,660 "reads": 11,661 "readers_count": 10,662 "score": 52.2,663 "yours": false,664 "topic_id": 88805,665 "topic_slug": "input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb",666 "display_username": "Wai Tik Chan",667 "primary_group_name": null,668 "flair_name": null,669 "flair_url": null,670 "flair_bg_color": null,671 "flair_color": null,672 "flair_group_id": null,673 "badges_granted": [],674 "version": 2,675 "can_edit": false,676 "can_delete": false,677 "can_recover": false,678 "can_see_hidden_post": false,679 "can_wiki": false,680 "read": true,681 "user_title": null,682 "reply_to_user": {683 "id": 34029,684 "username": "Wai_Tik_Chan",685 "name": "Wai Tik Chan",686 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png"687 },688 "bookmarked": false,689 "actions_summary": [],690 "moderator": false,691 "admin": false,692 "staff": false,693 "user_id": 34029,694 "hidden": false,695 "trust_level": 1,696 "deleted_at": null,697 "user_deleted": false,698 "edit_reason": null,699 "can_view_edit_history": true,700 "wiki": false,701 "post_url": "/t/input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb/88805/4",702 "can_accept_answer": false,703 "can_unaccept_answer": false,704 "accepted_answer": false,705 "topic_accepted_answer": null706 },707 {708 "id": 211695,709 "name": "Juan Montesinos",710 "username": "JuanFMontesinos",711 "avatar_template": "/user_avatar/discuss.pytorch.org/juanfmontesinos/{size}/76115_2.png",712 "created_at": "2020-07-13T10:02:04.089Z",713 "cooked": "<p>Hi,<br>\nThe basic input image (for a 224x224x3 tensor) would be<br>\n224<em>224</em>3=150528 elements (numbers)<br>\n602112 bytes = 0.574 Gb<br>\nSo in the end for a Batch size 2 and having 2 images per input we get<br>\n0.574<em>2</em>2 = 2.3 Gb</p>\n<p>Therefore I think you prob have a bug in the dataset/loader<br>\nSoo I would suggest to inspect the shape of the tensor before calling sending the tensor to the gpu as trying to allocate 86 Gb is way too far wrt the size it should be asking.</p>\n<p>Another options is that you passed a wrong input to the summary.</p>",714 "post_number": 5,715 "post_type": 1,716 "posts_count": 6,717 "updated_at": "2020-07-13T10:02:04.089Z",718 "reply_count": 1,719 "reply_to_post_number": 4,720 "quote_count": 0,721 "incoming_link_count": 4,722 "reads": 10,723 "readers_count": 9,724 "score": 27.0,725 "yours": false,726 "topic_id": 88805,727 "topic_slug": "input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb",728 "display_username": "Juan Montesinos",729 "primary_group_name": null,730 "flair_name": null,731 "flair_url": null,732 "flair_bg_color": null,733 "flair_color": null,734 "flair_group_id": null,735 "badges_granted": [],736 "version": 1,737 "can_edit": false,738 "can_delete": false,739 "can_recover": false,740 "can_see_hidden_post": false,741 "can_wiki": false,742 "read": true,743 "user_title": "",744 "reply_to_user": {745 "id": 34029,746 "username": "Wai_Tik_Chan",747 "name": "Wai Tik Chan",748 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png"749 },750 "bookmarked": false,751 "actions_summary": [],752 "moderator": false,753 "admin": false,754 "staff": false,755 "user_id": 9081,756 "hidden": false,757 "trust_level": 2,758 "deleted_at": null,759 "user_deleted": false,760 "edit_reason": null,761 "can_view_edit_history": true,762 "wiki": false,763 "post_url": "/t/input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb/88805/5",764 "can_accept_answer": false,765 "can_unaccept_answer": false,766 "accepted_answer": false,767 "topic_accepted_answer": null768 },769 {770 "id": 216977,771 "name": "Wai Tik Chan",772 "username": "Wai_Tik_Chan",773 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png",774 "created_at": "2020-07-30T13:46:29.241Z",775 "cooked": "<p>Hi Juan,</p>\n<p>Sorry for my very late reply and Thanks for your help again.<br>\nThe data size problem is solved and it is found that the model is not fit for torch summary to calculate the parameter size correctly, and after that my Jetson Nano is gone and I have changed to using Desktop to continuous on the journey, but actually, it is better than using jetson nano as it got more RAM to run instead of 4GB limitation. <img src=\"https://discuss.pytorch.org/images/emoji/apple/rofl.png?v=9\" title=\":rofl:\" class=\"emoji\" alt=\":rofl:\"></p>\n<p>Furthermore, I have got a little breakthrough on the model as well, if you are interested in, here is the notebook link for your review<br>\n<a href=\"https://www.kaggle.com/tik65536/low-cost-diamond-feature-preliminary-report\" class=\"onebox\" target=\"_blank\" rel=\"nofollow noopener\">https://www.kaggle.com/tik65536/low-cost-diamond-feature-preliminary-report</a></p>\n<p>I value your comments . <img src=\"https://discuss.pytorch.org/images/emoji/apple/muscle.png?v=9\" title=\":muscle:\" class=\"emoji\" alt=\":muscle:\"></p>\n<p>Thanks,<br>\nDick</p>",776 "post_number": 6,777 "post_type": 1,778 "posts_count": 6,779 "updated_at": "2020-07-30T13:46:29.241Z",780 "reply_count": 0,781 "reply_to_post_number": 5,782 "quote_count": 0,783 "incoming_link_count": 6,784 "reads": 9,785 "readers_count": 8,786 "score": 31.8,787 "yours": false,788 "topic_id": 88805,789 "topic_slug": "input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb",790 "display_username": "Wai Tik Chan",791 "primary_group_name": null,792 "flair_name": null,793 "flair_url": null,794 "flair_bg_color": null,795 "flair_color": null,796 "flair_group_id": null,797 "badges_granted": [],798 "version": 1,799 "can_edit": false,800 "can_delete": false,801 "can_recover": false,802 "can_see_hidden_post": false,803 "can_wiki": false,804 "link_counts": [805 {806 "url": "https://www.kaggle.com/tik65536/low-cost-diamond-feature-preliminary-report",807 "internal": false,808 "reflection": false,809 "title": "Low cost Diamond Feature - Preliminary Report | Kaggle",810 "clicks": 10811 }812 ],813 "read": true,814 "user_title": null,815 "reply_to_user": {816 "id": 9081,817 "username": "JuanFMontesinos",818 "name": "Juan Montesinos",819 "avatar_template": "/user_avatar/discuss.pytorch.org/juanfmontesinos/{size}/76115_2.png"820 },821 "bookmarked": false,822 "actions_summary": [],823 "moderator": false,824 "admin": false,825 "staff": false,826 "user_id": 34029,827 "hidden": false,828 "trust_level": 1,829 "deleted_at": null,830 "user_deleted": false,831 "edit_reason": null,832 "can_view_edit_history": true,833 "wiki": false,834 "post_url": "/t/input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb/88805/6",835 "can_accept_answer": false,836 "can_unaccept_answer": false,837 "accepted_answer": false,838 "topic_accepted_answer": null839 }840 ],841 "stream": [842 211268,843 211274,844 211585,845 211630,846 211695,847 216977848 ]849 },850 "timeline_lookup": [851 [852 1,853 1932854 ],855 [856 3,857 1931858 ],859 [860 6,861 1913862 ]863 ],864 "suggested_topics": [865 {866 "fancy_title": "Getting std::bad_alloc when loading the python tradined model in c++",867 "id": 212797,868 "title": "Getting std::bad_alloc when loading the python tradined model in c++",869 "slug": "getting-std-bad-alloc-when-loading-the-python-tradined-model-in-c",870 "posts_count": 1,871 "reply_count": 0,872 "highest_post_number": 1,873 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/4/c/4c64351ba5b8b679193c4d58afeb8bedb34260ab_2_1024x361.jpeg",874 "created_at": "2024-11-11T09:35:50.204Z",875 "last_posted_at": "2024-11-11T09:35:50.257Z",876 "bumped": true,877 "bumped_at": "2024-11-11T10:11:12.646Z",878 "archetype": "regular",879 "unseen": false,880 "pinned": false,881 "unpinned": null,882 "visible": true,883 "closed": false,884 "archived": false,885 "bookmarked": null,886 "liked": null,887 "tags_descriptions": {},888 "like_count": 0,889 "views": 80,890 "category_id": 1,891 "featured_link": null,892 "has_accepted_answer": false,893 "posters": [894 {895 "extras": "latest single",896 "description": "Original Poster, Most Recent Poster",897 "user": {898 "id": 80818,899 "username": "Naseef",900 "name": "Naseef",901 "avatar_template": "/user_avatar/discuss.pytorch.org/naseef/{size}/73911_2.png",902 "trust_level": 0903 }904 }905 ]906 },907 {908 "fancy_title": "Adding a TensorOption to Torch",909 "id": 214831,910 "title": "Adding a TensorOption to Torch",911 "slug": "adding-a-tensoroption-to-torch",912 "posts_count": 2,913 "reply_count": 0,914 "highest_post_number": 2,915 "image_url": null,916 "created_at": "2024-12-31T16:46:02.212Z",917 "last_posted_at": "2025-01-01T16:52:09.357Z",918 "bumped": true,919 "bumped_at": "2025-01-01T16:52:09.357Z",920 "archetype": "regular",921 "unseen": false,922 "pinned": false,923 "unpinned": null,924 "visible": true,925 "closed": false,926 "archived": false,927 "bookmarked": null,928 "liked": null,929 "tags_descriptions": {},930 "like_count": 0,931 "views": 78,932 "category_id": 1,933 "featured_link": null,934 "has_accepted_answer": false,935 "posters": [936 {937 "extras": "latest single",938 "description": "Original Poster, Most Recent Poster",939 "user": {940 "id": 81788,941 "username": "jackbondpreston",942 "name": "",943 "avatar_template": "/letter_avatar_proxy/v4/letter/j/58f4c7/{size}.png",944 "trust_level": 0945 }946 }947 ]948 },949 {950 "fancy_title": "Taking advantage of sparsity with FlexAttention",951 "id": 214331,952 "title": "Taking advantage of sparsity with FlexAttention",953 "slug": "taking-advantage-of-sparsity-with-flexattention",954 "posts_count": 1,955 "reply_count": 0,956 "highest_post_number": 1,957 "image_url": null,958 "created_at": "2024-12-17T19:24:08.318Z",959 "last_posted_at": "2024-12-17T19:24:08.359Z",960 "bumped": true,961 "bumped_at": "2024-12-17T19:24:08.359Z",962 "archetype": "regular",963 "unseen": false,964 "pinned": false,965 "unpinned": null,966 "visible": true,967 "closed": false,968 "archived": false,969 "bookmarked": null,970 "liked": null,971 "tags_descriptions": {},972 "like_count": 1,973 "views": 155,974 "category_id": 1,975 "featured_link": null,976 "has_accepted_answer": false,977 "posters": [978 {979 "extras": "latest single",980 "description": "Original Poster, Most Recent Poster",981 "user": {982 "id": 53185,983 "username": "cajoek",984 "name": "Johan Ek",985 "avatar_template": "/user_avatar/discuss.pytorch.org/cajoek/{size}/74573_2.png",986 "trust_level": 1987 }988 }989 ]990 },991 {992 "fancy_title": "Download models for sport event detection",993 "id": 219488,994 "title": "Download models for sport event detection",995 "slug": "download-models-for-sport-event-detection",996 "posts_count": 1,997 "reply_count": 0,998 "highest_post_number": 1,999 "image_url": null,1000 "created_at": "2025-04-26T14:21:32.760Z",1001 "last_posted_at": "2025-04-26T14:21:32.800Z",1002 "bumped": true,1003 "bumped_at": "2025-04-26T14:23:35.242Z",1004 "archetype": "regular",1005 "unseen": false,1006 "pinned": false,1007 "unpinned": null,1008 "visible": true,1009 "closed": false,1010 "archived": false,1011 "bookmarked": null,1012 "liked": null,1013 "tags_descriptions": {},1014 "like_count": 0,1015 "views": 48,1016 "category_id": 1,1017 "featured_link": null,1018 "has_accepted_answer": false,1019 "posters": [1020 {1021 "extras": "latest single",1022 "description": "Original Poster, Most Recent Poster",1023 "user": {1024 "id": 84024,1025 "username": "brainartfu1010",1026 "name": "Brain Art",1027 "avatar_template": "/user_avatar/discuss.pytorch.org/brainartfu1010/{size}/76799_2.png",1028 "trust_level": 01029 }1030 }1031 ]1032 },1033 {1034 "fancy_title": "Does `register_buffer` make a obj member or cls member?",1035 "id": 220155,1036 "title": "Does `register_buffer` make a obj member or cls member?",1037 "slug": "does-register-buffer-make-a-obj-member-or-cls-member",1038 "posts_count": 3,1039 "reply_count": 1,1040 "highest_post_number": 3,1041 "image_url": null,1042 "created_at": "2025-05-19T09:29:30.499Z",1043 "last_posted_at": "2025-05-21T16:35:20.977Z",1044 "bumped": true,1045 "bumped_at": "2025-05-21T16:35:20.977Z",1046 "archetype": "regular",1047 "unseen": false,1048 "pinned": false,1049 "unpinned": null,1050 "visible": true,1051 "closed": false,1052 "archived": false,1053 "bookmarked": null,1054 "liked": null,1055 "tags_descriptions": {},1056 "like_count": 0,1057 "views": 56,1058 "category_id": 1,1059 "featured_link": null,1060 "has_accepted_answer": true,1061 "posters": [1062 {1063 "extras": "latest",1064 "description": "Original Poster, Most Recent Poster",1065 "user": {1066 "id": 59649,1067 "username": "evilroach",1068 "name": "Evil Roach",1069 "avatar_template": "/user_avatar/discuss.pytorch.org/evilroach/{size}/53515_2.png",1070 "trust_level": 11071 }1072 },1073 {1074 "extras": null,1075 "description": "Frequent Poster, Accepted Answer",1076 "user": {1077 "id": 3534,1078 "username": "ptrblck",1079 "name": "",1080 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1081 "admin": true,1082 "moderator": true,1083 "trust_level": 21084 }1085 }1086 ]1087 }1088 ],1089 "tags_descriptions": {},1090 "fancy_title": "Input size(mb) of a 6 x 224 x 224 tensor shows 84GB",1091 "id": 88805,1092 "title": "Input size(mb) of a 6 x 224 x 224 tensor shows 84GB",1093 "posts_count": 6,1094 "created_at": "2020-07-11T14:30:22.559Z",1095 "views": 1291,1096 "reply_count": 4,1097 "like_count": 0,1098 "last_posted_at": "2020-07-30T13:46:29.241Z",1099 "visible": true,1100 "closed": false,1101 "archived": false,1102 "has_summary": false,1103 "archetype": "regular",1104 "slug": "input-size-mb-of-a-6-x-224-x-224-tensor-shows-84gb",1105 "category_id": 1,1106 "word_count": 1162,1107 "deleted_at": null,1108 "user_id": 34029,1109 "featured_link": null,1110 "pinned_globally": false,1111 "pinned_at": null,1112 "pinned_until": null,1113 "image_url": null,1114 "slow_mode_seconds": 0,1115 "draft": null,1116 "draft_key": "topic_88805",1117 "draft_sequence": null,1118 "unpinned": null,1119 "pinned": false,1120 "current_post_number": 1,1121 "highest_post_number": 6,1122 "deleted_by": null,1123 "actions_summary": [1124 {1125 "id": 4,1126 "count": 0,1127 "hidden": false,1128 "can_act": false1129 },1130 {1131 "id": 8,1132 "count": 0,1133 "hidden": false,1134 "can_act": false1135 },1136 {1137 "id": 10,1138 "count": 0,1139 "hidden": false,1140 "can_act": false1141 },1142 {1143 "id": 7,1144 "count": 0,1145 "hidden": false,1146 "can_act": false1147 }1148 ],1149 "chunk_size": 20,1150 "bookmarked": false,1151 "topic_timer": null,1152 "message_bus_last_id": 0,1153 "participant_count": 2,1154 "show_read_indicator": false,1155 "thumbnails": null,1156 "slow_mode_enabled_until": null,1157 "can_vote": false,1158 "vote_count": 0,1159 "user_voted": false,1160 "discourse_zendesk_plugin_zendesk_id": null,1161 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1162 "details": {1163 "can_edit": false,1164 "notification_level": 1,1165 "participants": [1166 {1167 "id": 34029,1168 "username": "Wai_Tik_Chan",1169 "name": "Wai Tik Chan",1170 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png",1171 "post_count": 4,1172 "primary_group_name": null,1173 "flair_name": null,1174 "flair_url": null,1175 "flair_color": null,1176 "flair_bg_color": null,1177 "flair_group_id": null,1178 "trust_level": 11179 },1180 {1181 "id": 9081,1182 "username": "JuanFMontesinos",1183 "name": "Juan Montesinos",1184 "avatar_template": "/user_avatar/discuss.pytorch.org/juanfmontesinos/{size}/76115_2.png",1185 "post_count": 2,1186 "primary_group_name": null,1187 "flair_name": null,1188 "flair_url": null,1189 "flair_color": null,1190 "flair_bg_color": null,1191 "flair_group_id": null,1192 "trust_level": 21193 }1194 ],1195 "created_by": {1196 "id": 34029,1197 "username": "Wai_Tik_Chan",1198 "name": "Wai Tik Chan",1199 "avatar_template": "/user_avatar/discuss.pytorch.org/wai_tik_chan/{size}/15819_2.png"1200 },