Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 368555,7 "name": "",8 "username": "Sreeharan",9 "avatar_template": "/letter_avatar_proxy/v4/letter/s/ecd19e/{size}.png",10 "created_at": "2022-10-02T18:12:31.485Z",11 "cooked": "<p>I’m trying to calculate the confusion matrix using torchmetrics for my multi-label output, but I get the following error:</p>\n<pre><code>File \"/home/antpc/.local/lib/python3.8/site-packages/torchmetrics/metric.py\", line 394, in wrapped_func\n raise RuntimeError(\nRuntimeError: Encountered different devices in metric calculation (see stacktrace for details).This could be due to the metric class not being on the same device as input.Instead of `metric=ConfusionMatrix(...)` try to do `metric=ConfusionMatrix(...).to(device)` where device corresponds to the device of the input.\n</code></pre>\n<p>My code:</p>\n<pre><code>from torchmetrics import ConfusionMatrix\ndef calculate_metrics(predictions, targets):\n\tcm = ConfusionMatrix(num_classes=34, multilabel=True)\n\tmatrix = cm(predictions, targets)\n\treturn matrix\n</code></pre>\n<p>Then I tried to change my code as:</p>\n<pre><code>from torchmetrics import ConfusionMatrix\ndef calculate_metrics(predictions, targets):\n\tcm = ConfusionMatrix(num_classes=34, multilabel=True).to(device='cpu')\n\tmatrix = cm(predictions.detach().cpu(), targets.detach().cpu())\n\treturn matrix\n</code></pre>\n<p>Still it shows the same error. Can anyone help me out with this?</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 3,15 "updated_at": "2022-10-02T18:12:31.485Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 1385,20 "reads": 17,21 "readers_count": 16,22 "score": 6928.4,23 "yours": false,24 "topic_id": 162633,25 "topic_slug": "torchmetrics-multi-label-confusion-matrix-different-device-error",26 "display_username": "",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": 59781,48 "hidden": false,49 "trust_level": 0,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/torchmetrics-multi-label-confusion-matrix-different-device-error/162633/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 "id": 368574,64 "name": "",65 "username": "ptrblck",66 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",67 "created_at": "2022-10-02T22:50:36.461Z",68 "cooked": "<p>Could you post a minimal, executable code snippet by adding the missing definitions, which would reproduce the issue, please?</p>",69 "post_number": 2,70 "post_type": 1,71 "posts_count": 3,72 "updated_at": "2022-10-02T22:50:36.461Z",73 "reply_count": 0,74 "reply_to_post_number": null,75 "quote_count": 0,76 "incoming_link_count": 5,77 "reads": 16,78 "readers_count": 15,79 "score": 28.2,80 "yours": false,81 "topic_id": 162633,82 "topic_slug": "torchmetrics-multi-label-confusion-matrix-different-device-error",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/torchmetrics-multi-label-confusion-matrix-different-device-error/162633/2",113 "can_accept_answer": false,114 "can_unaccept_answer": false,115 "accepted_answer": false,116 "topic_accepted_answer": null117 },118 {119 "id": 368630,120 "name": "",121 "username": "Sreeharan",122 "avatar_template": "/letter_avatar_proxy/v4/letter/s/ecd19e/{size}.png",123 "created_at": "2022-10-03T08:23:55.986Z",124 "cooked": "<p>The code is written in pytorch lightning.</p>\n<pre><code class=\"lang-auto\">from torch import optim, nn\nimport pytorch_lightning as pl\nfrom torchmetrics import ConfusionMatrix\n\nclass ModelClassifier(pl.LightningModule):\n def __init__(self):\n super(ModelClassifier, self).__init__()\n self.model = nn.Linear(3*512*512 ,out_features=34)\n self.loss_fn = nn.BCEWithLogitsLoss()\n self.cm = ConfusionMatrix(num_classes=34, multilabel=True).to(device='cpu')\n\n def forward(self, x):\n batch_size, _, _, _ = x.size()\n x = x.view(batch_size,-1)\n x = self.model(x)\n return x\n \n def configure_optimizers(self):\n optimizer = optim.Adam(self.parameters(), lr=0.01)\n return optimizer\n \n def loss_func(self, pred, labels):\n return self.loss_fn(pred,labels)\n \n def calculate_metrics(self, pred, labels):\n confusion_matrix = self.cm(pred.detach().cpu(), labels.detach().cpu())\n return confusion_matrix\n\n def training_step(self, batch, batch_idx):\n inputs, labels = batch\n\n outputs = self(inputs)\n loss = self.loss_fn(outputs, labels.float())\n metrics = self.calculate_metrics(outputs, labels)\n \n return loss\n\nmodel = ModelClassifier()\n\ntrainer = pl.Trainer(strategy='dp', max_epochs=150, gpus=8, fast_dev_run=True)\n\ntrainer.fit(model, train_loader)\n</code></pre>\n<p>Here the train_loader contains images of size: (3 X 512 X 512) with a batch size of 32.</p>",125 "post_number": 3,126 "post_type": 1,127 "posts_count": 3,128 "updated_at": "2022-10-03T08:23:55.986Z",129 "reply_count": 0,130 "reply_to_post_number": null,131 "quote_count": 0,132 "incoming_link_count": 20,133 "reads": 16,134 "readers_count": 15,135 "score": 103.2,136 "yours": false,137 "topic_id": 162633,138 "topic_slug": "torchmetrics-multi-label-confusion-matrix-different-device-error",139 "display_username": "",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 "bookmarked": false,156 "actions_summary": [],157 "moderator": false,158 "admin": false,159 "staff": false,160 "user_id": 59781,161 "hidden": false,162 "trust_level": 0,163 "deleted_at": null,164 "user_deleted": false,165 "edit_reason": null,166 "can_view_edit_history": true,167 "wiki": false,168 "post_url": "/t/torchmetrics-multi-label-confusion-matrix-different-device-error/162633/3",169 "can_accept_answer": false,170 "can_unaccept_answer": false,171 "accepted_answer": false,172 "topic_accepted_answer": null173 }174 ],175 "stream": [176 368555,177 368574,178 368630179 ]180 },181 "timeline_lookup": [182 [183 1,184 1119185 ],186 [187 3,188 1118189 ]190 ],191 "suggested_topics": [192 {193 "fancy_title": "[Bug] Memory leak in C++ libtorch",194 "id": 214376,195 "title": "[Bug] Memory leak in C++ libtorch",196 "slug": "bug-memory-leak-in-c-libtorch",197 "posts_count": 4,198 "reply_count": 1,199 "highest_post_number": 4,200 "image_url": null,201 "created_at": "2024-12-18T23:19:15.780Z",202 "last_posted_at": "2024-12-19T09:06:49.848Z",203 "bumped": true,204 "bumped_at": "2024-12-19T09:06:49.848Z",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": 1,216 "views": 68,217 "category_id": 1,218 "featured_link": null,219 "has_accepted_answer": false,220 "posters": [221 {222 "extras": "latest",223 "description": "Original Poster, Most Recent Poster",224 "user": {225 "id": 52896,226 "username": "Theophile_Champion",227 "name": "Theophile Champion",228 "avatar_template": "/user_avatar/discuss.pytorch.org/theophile_champion/{size}/30397_2.png",229 "trust_level": 1230 }231 },232 {233 "extras": null,234 "description": "Frequent Poster",235 "user": {236 "id": 41396,237 "username": "soulitzer",238 "name": "",239 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",240 "trust_level": 2241 }242 }243 ]244 },245 {246 "fancy_title": "Changing the backbone",247 "id": 212284,248 "title": "Changing the backbone",249 "slug": "changing-the-backbone",250 "posts_count": 3,251 "reply_count": 0,252 "highest_post_number": 3,253 "image_url": null,254 "created_at": "2024-10-29T15:27:33.798Z",255 "last_posted_at": "2024-11-08T05:37:31.700Z",256 "bumped": true,257 "bumped_at": "2024-11-08T05:37:31.700Z",258 "archetype": "regular",259 "unseen": false,260 "pinned": false,261 "unpinned": null,262 "visible": true,263 "closed": false,264 "archived": false,265 "bookmarked": null,266 "liked": null,267 "tags_descriptions": {},268 "like_count": 0,269 "views": 97,270 "category_id": 1,271 "featured_link": null,272 "has_accepted_answer": false,273 "posters": [274 {275 "extras": "latest",276 "description": "Original Poster, Most Recent Poster",277 "user": {278 "id": 76804,279 "username": "afnhs-gs",280 "name": "semba",281 "avatar_template": "/letter_avatar_proxy/v4/letter/a/c5a1d2/{size}.png",282 "trust_level": 1283 }284 },285 {286 "extras": null,287 "description": "Frequent Poster",288 "user": {289 "id": 3534,290 "username": "ptrblck",291 "name": "",292 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",293 "admin": true,294 "moderator": true,295 "trust_level": 2296 }297 }298 ]299 },300 {301 "fancy_title": "Understanding Encoder-Decoder Transformer Architecture in Image Captioning",302 "id": 215322,303 "title": "Understanding Encoder-Decoder Transformer Architecture in Image Captioning",304 "slug": "understanding-encoder-decoder-transformer-architecture-in-image-captioning",305 "posts_count": 1,306 "reply_count": 0,307 "highest_post_number": 1,308 "image_url": null,309 "created_at": "2025-01-13T11:28:56.543Z",310 "last_posted_at": "2025-01-13T11:28:56.633Z",311 "bumped": true,312 "bumped_at": "2025-01-13T11:28:56.633Z",313 "archetype": "regular",314 "unseen": false,315 "pinned": false,316 "unpinned": null,317 "visible": true,318 "closed": false,319 "archived": false,320 "bookmarked": null,321 "liked": null,322 "tags_descriptions": {},323 "like_count": 0,324 "views": 82,325 "category_id": 1,326 "featured_link": null,327 "has_accepted_answer": false,328 "posters": [329 {330 "extras": "latest single",331 "description": "Original Poster, Most Recent Poster",332 "user": {333 "id": 80254,334 "username": "sriramgs",335 "name": "Sriram",336 "avatar_template": "/letter_avatar_proxy/v4/letter/s/c0e974/{size}.png",337 "trust_level": 1338 }339 }340 ]341 },342 {343 "fancy_title": "New AI TTS System with Emotion Control",344 "id": 215473,345 "title": "New AI TTS System with Emotion Control",346 "slug": "new-ai-tts-system-with-emotion-control",347 "posts_count": 1,348 "reply_count": 0,349 "highest_post_number": 1,350 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/1/b/1b5acf26473b4da5045b72b1251774ba7a160bf4_2_1024x482.png",351 "created_at": "2025-01-16T13:35:46.056Z",352 "last_posted_at": "2025-01-16T13:35:46.091Z",353 "bumped": true,354 "bumped_at": "2025-01-16T13:35:46.091Z",355 "archetype": "regular",356 "unseen": false,357 "pinned": false,358 "unpinned": null,359 "visible": true,360 "closed": false,361 "archived": false,362 "bookmarked": null,363 "liked": null,364 "tags_descriptions": {},365 "like_count": 0,366 "views": 214,367 "category_id": 1,368 "featured_link": null,369 "has_accepted_answer": false,370 "posters": [371 {372 "extras": "latest single",373 "description": "Original Poster, Most Recent Poster",374 "user": {375 "id": 82116,376 "username": "Saifs_AI",377 "name": "Saifs AI",378 "avatar_template": "/letter_avatar_proxy/v4/letter/s/3da27b/{size}.png",379 "trust_level": 0380 }381 }382 ]383 },384 {385 "fancy_title": "Torch operation right after TensorRT’s execute_async_v3",386 "id": 216329,387 "title": "Torch operation right after TensorRT's execute_async_v3",388 "slug": "torch-operation-right-after-tensorrts-execute-async-v3",389 "posts_count": 1,390 "reply_count": 0,391 "highest_post_number": 1,392 "image_url": null,393 "created_at": "2025-02-06T18:51:31.494Z",394 "last_posted_at": "2025-02-06T18:51:31.538Z",395 "bumped": true,396 "bumped_at": "2025-02-06T19:17:38.477Z",397 "archetype": "regular",398 "unseen": false,399 "pinned": false,400 "unpinned": null,401 "visible": true,402 "closed": false,403 "archived": false,404 "bookmarked": null,405 "liked": null,406 "tags_descriptions": {},407 "like_count": 0,408 "views": 220,409 "category_id": 1,410 "featured_link": null,411 "has_accepted_answer": false,412 "posters": [413 {414 "extras": "latest single",415 "description": "Original Poster, Most Recent Poster",416 "user": {417 "id": 82530,418 "username": "J4Q8",419 "name": "Jakub Łucki",420 "avatar_template": "/user_avatar/discuss.pytorch.org/j4q8/{size}/75512_2.png",421 "trust_level": 1422 }423 }424 ]425 }426 ],427 "tags_descriptions": {},428 "fancy_title": "torchmetrics: Multi label Confusion matrix different device error",429 "id": 162633,430 "title": "torchmetrics: Multi label Confusion matrix different device error",431 "posts_count": 3,432 "created_at": "2022-10-02T18:12:31.412Z",433 "views": 2042,434 "reply_count": 0,435 "like_count": 0,436 "last_posted_at": "2022-10-03T08:23:55.986Z",437 "visible": true,438 "closed": false,439 "archived": false,440 "has_summary": false,441 "archetype": "regular",442 "slug": "torchmetrics-multi-label-confusion-matrix-different-device-error",443 "category_id": 1,444 "word_count": 348,445 "deleted_at": null,446 "user_id": 59781,447 "featured_link": null,448 "pinned_globally": false,449 "pinned_at": null,450 "pinned_until": null,451 "image_url": null,452 "slow_mode_seconds": 0,453 "draft": null,454 "draft_key": "topic_162633",455 "draft_sequence": null,456 "unpinned": null,457 "pinned": false,458 "current_post_number": 1,459 "highest_post_number": 3,460 "deleted_by": null,461 "actions_summary": [462 {463 "id": 4,464 "count": 0,465 "hidden": false,466 "can_act": false467 },468 {469 "id": 8,470 "count": 0,471 "hidden": false,472 "can_act": false473 },474 {475 "id": 10,476 "count": 0,477 "hidden": false,478 "can_act": false479 },480 {481 "id": 7,482 "count": 0,483 "hidden": false,484 "can_act": false485 }486 ],487 "chunk_size": 20,488 "bookmarked": false,489 "topic_timer": null,490 "message_bus_last_id": 0,491 "participant_count": 2,492 "show_read_indicator": false,493 "thumbnails": null,494 "slow_mode_enabled_until": null,495 "can_vote": false,496 "vote_count": 0,497 "user_voted": false,498 "discourse_zendesk_plugin_zendesk_id": null,499 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",500 "details": {501 "can_edit": false,502 "notification_level": 1,503 "participants": [504 {505 "id": 59781,506 "username": "Sreeharan",507 "name": "",508 "avatar_template": "/letter_avatar_proxy/v4/letter/s/ecd19e/{size}.png",509 "post_count": 2,510 "primary_group_name": null,511 "flair_name": null,512 "flair_url": null,513 "flair_color": null,514 "flair_bg_color": null,515 "flair_group_id": null,516 "trust_level": 0517 },518 {519 "id": 3534,520 "username": "ptrblck",521 "name": "",522 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",523 "post_count": 1,524 "primary_group_name": null,525 "flair_name": null,526 "flair_url": null,527 "flair_color": null,528 "flair_bg_color": null,529 "flair_group_id": null,530 "admin": true,531 "moderator": true,532 "trust_level": 2533 }534 ],535 "created_by": {536 "id": 59781,537 "username": "Sreeharan",538 "name": "",539 "avatar_template": "/letter_avatar_proxy/v4/letter/s/ecd19e/{size}.png"540 },541 "last_poster": {542 "id": 59781,543 "username": "Sreeharan",544 "name": "",545 "avatar_template": "/letter_avatar_proxy/v4/letter/s/ecd19e/{size}.png"546 }547 },548 "bookmarks": []549 },550 {551 "post_stream": {552 "posts": [553 {554 "id": 368624,555 "name": "",556 "username": "tommas",557 "avatar_template": "/user_avatar/discuss.pytorch.org/tommas/{size}/53682_2.png",558 "created_at": "2022-10-03T07:14:59.922Z",559 "cooked": "<p>Hi there, I’m using StreamReader in torchaudio to process video. However, when using method add_basic_video_stream(), I encountered an error: <strong>Failed to create the filter from “fps=1,format=pix_fmts=rgb24” (Invalid argument.).</strong></p>\n<p>Here is my source code creating the config:</p>\n<pre><code class=\"lang-auto\">s = StreamReader(src)\ns.add_basic_video_stream(\n frames_per_chunk=1,\n format=\"rgb24\",\n decoder=\"h264_cuvid\",\n frame_rate=1,\n hw_accel=\"cuda:0\"\n )\n</code></pre>\n<p>Here is my torch and torchaudio nightly version:</p>\n<pre><code class=\"lang-auto\">1.13.0.dev20220914+cu113\n0.13.0.dev20220914+cu113\n</code></pre>\n<p>Can someone help me with this? Thank you all in advance.</p>",560 "post_number": 1,561 "post_type": 1,562 "posts_count": 2,563 "updated_at": "2022-10-03T07:15:43.730Z",564 "reply_count": 0,565 "reply_to_post_number": null,566 "quote_count": 0,567 "incoming_link_count": 196,568 "reads": 4,569 "readers_count": 3,570 "score": 980.8,571 "yours": false,572 "topic_id": 162673,573 "topic_slug": "failed-to-create-the-filter-from-fps-1-format-pix-fmts-rgb24-invalid-argument",574 "display_username": "",575 "primary_group_name": null,576 "flair_name": null,577 "flair_url": null,578 "flair_bg_color": null,579 "flair_color": null,580 "flair_group_id": null,581 "badges_granted": [],582 "version": 1,583 "can_edit": false,584 "can_delete": false,585 "can_recover": false,586 "can_see_hidden_post": false,587 "can_wiki": false,588 "read": true,589 "user_title": null,590 "bookmarked": false,591 "actions_summary": [],592 "moderator": false,593 "admin": false,594 "staff": false,595 "user_id": 59795,596 "hidden": false,597 "trust_level": 0,598 "deleted_at": null,599 "user_deleted": false,600 "edit_reason": null,601 "can_view_edit_history": true,602 "wiki": false,603 "post_url": "/t/failed-to-create-the-filter-from-fps-1-format-pix-fmts-rgb24-invalid-argument/162673/1",604 "can_accept_answer": false,605 "can_unaccept_answer": false,606 "accepted_answer": false,607 "topic_accepted_answer": null,608 "can_vote": false609 },610 {611 "id": 368625,612 "name": "",613 "username": "tommas",614 "avatar_template": "/user_avatar/discuss.pytorch.org/tommas/{size}/53682_2.png",615 "created_at": "2022-10-03T07:18:37.875Z",616 "cooked": "<p>For more information about my device information, I am running on <strong>Ubuntu 20.04.3 LTS</strong>, 2 NVIDIA GeForce RTX 3090.</p>",617 "post_number": 2,618 "post_type": 1,619 "posts_count": 2,620 "updated_at": "2022-10-03T07:18:37.875Z",621 "reply_count": 0,622 "reply_to_post_number": null,623 "quote_count": 0,624 "incoming_link_count": 0,625 "reads": 4,626 "readers_count": 3,627 "score": 0.8,628 "yours": false,629 "topic_id": 162673,630 "topic_slug": "failed-to-create-the-filter-from-fps-1-format-pix-fmts-rgb24-invalid-argument",631 "display_username": "",632 "primary_group_name": null,633 "flair_name": null,634 "flair_url": null,635 "flair_bg_color": null,636 "flair_color": null,637 "flair_group_id": null,638 "badges_granted": [],639 "version": 1,640 "can_edit": false,641 "can_delete": false,642 "can_recover": false,643 "can_see_hidden_post": false,644 "can_wiki": false,645 "read": true,646 "user_title": null,647 "bookmarked": false,648 "actions_summary": [],649 "moderator": false,650 "admin": false,651 "staff": false,652 "user_id": 59795,653 "hidden": false,654 "trust_level": 0,655 "deleted_at": null,656 "user_deleted": false,657 "edit_reason": null,658 "can_view_edit_history": true,659 "wiki": false,660 "post_url": "/t/failed-to-create-the-filter-from-fps-1-format-pix-fmts-rgb24-invalid-argument/162673/2",661 "can_accept_answer": false,662 "can_unaccept_answer": false,663 "accepted_answer": false,664 "topic_accepted_answer": null665 }666 ],667 "stream": [668 368624,669 368625670 ]671 },672 "timeline_lookup": [673 [674 1,675 1119676 ]677 ],678 "suggested_topics": [679 {680 "fancy_title": "KeyError:’Keypoints’ in Pytorch-How to resolve this?",681 "id": 213064,682 "title": "KeyError:'Keypoints' in Pytorch-How to resolve this?",683 "slug": "keyerror-keypoints-in-pytorch-how-to-resolve-this",684 "posts_count": 3,685 "reply_count": 3,686 "highest_post_number": 5,687 "image_url": null,688 "created_at": "2024-11-17T06:23:24.945Z",689 "last_posted_at": "2024-11-25T01:32:02.991Z",690 "bumped": true,691 "bumped_at": "2024-11-25T01:32:02.991Z",692 "archetype": "regular",693 "unseen": false,694 "pinned": false,695 "unpinned": null,696 "visible": true,697 "closed": false,698 "archived": false,699 "bookmarked": null,700 "liked": null,701 "tags_descriptions": {},702 "like_count": 0,703 "views": 185,704 "category_id": 5,705 "featured_link": null,706 "has_accepted_answer": false,707 "posters": [708 {709 "extras": null,710 "description": "Original Poster",711 "user": {712 "id": 80946,713 "username": "Mudith_Nahata",714 "name": "Mudith Nahata",715 "avatar_template": "/letter_avatar_proxy/v4/letter/m/ed8c4c/{size}.png",716 "trust_level": 1717 }718 },719 {720 "extras": "latest",721 "description": "Most Recent Poster",722 "user": {723 "id": 74591,724 "username": "UMAR_MASUD",725 "name": "UMAR MASUD",726 "avatar_template": "/user_avatar/discuss.pytorch.org/umar_masud/{size}/68863_2.png",727 "trust_level": 2728 }729 }730 ]731 },732 {733 "fancy_title": "Residual Connection breaks or not while calling separately",734 "id": 213792,735 "title": "Residual Connection breaks or not while calling separately",736 "slug": "residual-connection-breaks-or-not-while-calling-separately",737 "posts_count": 2,738 "reply_count": 0,739 "highest_post_number": 2,740 "image_url": null,741 "created_at": "2024-12-04T09:43:35.728Z",742 "last_posted_at": "2024-12-04T22:23:14.123Z",743 "bumped": true,744 "bumped_at": "2024-12-04T22:23:14.123Z",745 "archetype": "regular",746 "unseen": false,747 "pinned": false,748 "unpinned": null,749 "visible": true,750 "closed": false,751 "archived": false,752 "bookmarked": null,753 "liked": null,754 "tags_descriptions": {},755 "like_count": 0,756 "views": 33,757 "category_id": 5,758 "featured_link": null,759 "has_accepted_answer": false,760 "posters": [761 {762 "extras": null,763 "description": "Original Poster",764 "user": {765 "id": 68774,766 "username": "hasan11085",767 "name": "Mahmudul Hasan",768 "avatar_template": "/user_avatar/discuss.pytorch.org/hasan11085/{size}/63260_2.png",769 "trust_level": 1770 }771 },772 {773 "extras": "latest",774 "description": "Most Recent Poster",775 "user": {776 "id": 3534,777 "username": "ptrblck",778 "name": "",779 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",780 "admin": true,781 "moderator": true,782 "trust_level": 2783 }784 }785 ]786 },787 {788 "fancy_title": "Image classification with PyTorch",789 "id": 213930,790 "title": "Image classification with PyTorch",791 "slug": "image-classification-with-pytorch",792 "posts_count": 3,793 "reply_count": 0,794 "highest_post_number": 3,795 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/1/3/1381695a6060aefe405ffb28aebaae5a42069aa6_2_1024x635.jpeg",796 "created_at": "2024-12-06T22:46:10.375Z",797 "last_posted_at": "2024-12-09T16:57:34.885Z",798 "bumped": true,799 "bumped_at": "2024-12-09T16:57:34.885Z",800 "archetype": "regular",801 "unseen": false,802 "pinned": false,803 "unpinned": null,804 "visible": true,805 "closed": false,806 "archived": false,807 "bookmarked": null,808 "liked": null,809 "tags_descriptions": {},810 "like_count": 0,811 "views": 291,812 "category_id": 5,813 "featured_link": null,814 "has_accepted_answer": false,815 "posters": [816 {817 "extras": null,818 "description": "Original Poster",819 "user": {820 "id": 81369,821 "username": "Arek",822 "name": "Arek",823 "avatar_template": "/letter_avatar_proxy/v4/letter/a/46a35a/{size}.png",824 "trust_level": 0825 }826 },827 {828 "extras": null,829 "description": "Frequent Poster",830 "user": {831 "id": 3534,832 "username": "ptrblck",833 "name": "",834 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",835 "admin": true,836 "moderator": true,837 "trust_level": 2838 }839 },840 {841 "extras": "latest",842 "description": "Most Recent Poster",843 "user": {844 "id": 64498,845 "username": "nickums",846 "name": "Nickums",847 "avatar_template": "/user_avatar/discuss.pytorch.org/nickums/{size}/58652_2.png",848 "trust_level": 1849 }850 }851 ]852 },853 {854 "fancy_title": "I don’t no my forward pass and backward pass is too high in my code , that is about Forward/backward pass size (MB): 67652215240073.80",855 "id": 215676,856 "title": "I don't no my forward pass and backward pass is too high in my code , that is about Forward/backward pass size (MB): 67652215240073.80",857 "slug": "i-dont-no-my-forward-pass-and-backward-pass-is-too-high-in-my-code-that-is-about-forward-backward-pass-size-mb-67652215240073-80",858 "posts_count": 2,859 "reply_count": 0,860 "highest_post_number": 2,861 "image_url": null,862 "created_at": "2025-01-21T14:29:44.889Z",863 "last_posted_at": "2025-01-21T15:03:00.388Z",864 "bumped": true,865 "bumped_at": "2025-01-21T15:03:00.388Z",866 "archetype": "regular",867 "unseen": false,868 "pinned": false,869 "unpinned": null,870 "visible": true,871 "closed": false,872 "archived": false,873 "bookmarked": null,874 "liked": null,875 "tags_descriptions": {},876 "like_count": 0,877 "views": 39,878 "category_id": 5,879 "featured_link": null,880 "has_accepted_answer": false,881 "posters": [882 {883 "extras": null,884 "description": "Original Poster",885 "user": {886 "id": 82221,887 "username": "Goutham",888 "name": "Goutham",889 "avatar_template": "/user_avatar/discuss.pytorch.org/goutham/{size}/75223_2.png",890 "trust_level": 0891 }892 },893 {894 "extras": "latest",895 "description": "Most Recent Poster",896 "user": {897 "id": 3534,898 "username": "ptrblck",899 "name": "",900 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",901 "admin": true,902 "moderator": true,903 "trust_level": 2904 }905 }906 ]907 },908 {909 "fancy_title": "How to load the best weights of yolov6 after training?",910 "id": 216017,911 "title": "How to load the best weights of yolov6 after training?",912 "slug": "how-to-load-the-best-weights-of-yolov6-after-training",913 "posts_count": 2,914 "reply_count": 0,915 "highest_post_number": 2,916 "image_url": null,917 "created_at": "2025-01-29T06:31:26.226Z",918 "last_posted_at": "2025-01-29T22:50:32.204Z",919 "bumped": true,920 "bumped_at": "2025-01-29T22:50:32.204Z",921 "archetype": "regular",922 "unseen": false,923 "pinned": false,924 "unpinned": null,925 "visible": true,926 "closed": false,927 "archived": false,928 "bookmarked": null,929 "liked": null,930 "tags_descriptions": {},931 "like_count": 0,932 "views": 116,933 "category_id": 5,934 "featured_link": null,935 "has_accepted_answer": false,936 "posters": [937 {938 "extras": null,939 "description": "Original Poster",940 "user": {941 "id": 78758,942 "username": "edgy_sharma",943 "name": "kanchi sharma",944 "avatar_template": "/user_avatar/discuss.pytorch.org/edgy_sharma/{size}/72607_2.png",945 "trust_level": 1946 }947 },948 {949 "extras": "latest",950 "description": "Most Recent Poster",951 "user": {952 "id": 3534,953 "username": "ptrblck",954 "name": "",955 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",956 "admin": true,957 "moderator": true,958 "trust_level": 2959 }960 }961 ]962 }963 ],964 "tags_descriptions": {},965 "fancy_title": "Failed to create the filter from “fps=1,format=pix_fmts=rgb24” (Invalid argument)",966 "id": 162673,967 "title": "Failed to create the filter from \"fps=1,format=pix_fmts=rgb24\" (Invalid argument)",968 "posts_count": 2,969 "created_at": "2022-10-03T07:14:59.835Z",970 "views": 444,971 "reply_count": 0,972 "like_count": 0,973 "last_posted_at": "2022-10-03T07:18:37.875Z",974 "visible": true,975 "closed": false,976 "archived": false,977 "has_summary": false,978 "archetype": "regular",979 "slug": "failed-to-create-the-filter-from-fps-1-format-pix-fmts-rgb24-invalid-argument",980 "category_id": 5,981 "word_count": 107,982 "deleted_at": null,983 "user_id": 59795,984 "featured_link": null,985 "pinned_globally": false,986 "pinned_at": null,987 "pinned_until": null,988 "image_url": null,989 "slow_mode_seconds": 0,990 "draft": null,991 "draft_key": "topic_162673",992 "draft_sequence": null,993 "unpinned": null,994 "pinned": false,995 "current_post_number": 1,996 "highest_post_number": 2,997 "deleted_by": null,998 "actions_summary": [999 {1000 "id": 4,1001 "count": 0,1002 "hidden": false,1003 "can_act": false1004 },1005 {1006 "id": 8,1007 "count": 0,1008 "hidden": false,1009 "can_act": false1010 },1011 {1012 "id": 10,1013 "count": 0,1014 "hidden": false,1015 "can_act": false1016 },1017 {1018 "id": 7,1019 "count": 0,1020 "hidden": false,1021 "can_act": false1022 }1023 ],1024 "chunk_size": 20,1025 "bookmarked": false,1026 "topic_timer": null,1027 "message_bus_last_id": 0,1028 "participant_count": 1,1029 "show_read_indicator": false,1030 "thumbnails": null,1031 "slow_mode_enabled_until": null,1032 "can_vote": false,1033 "vote_count": 0,1034 "user_voted": false,1035 "discourse_zendesk_plugin_zendesk_id": null,1036 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1037 "details": {1038 "can_edit": false,1039 "notification_level": 1,1040 "participants": [1041 {1042 "id": 59795,1043 "username": "tommas",1044 "name": "",1045 "avatar_template": "/user_avatar/discuss.pytorch.org/tommas/{size}/53682_2.png",1046 "post_count": 2,1047 "primary_group_name": null,1048 "flair_name": null,1049 "flair_url": null,1050 "flair_color": null,1051 "flair_bg_color": null,1052 "flair_group_id": null,1053 "trust_level": 01054 }1055 ],1056 "created_by": {1057 "id": 59795,1058 "username": "tommas",1059 "name": "",1060 "avatar_template": "/user_avatar/discuss.pytorch.org/tommas/{size}/53682_2.png"1061 },1062 "last_poster": {1063 "id": 59795,1064 "username": "tommas",1065 "name": "",1066 "avatar_template": "/user_avatar/discuss.pytorch.org/tommas/{size}/53682_2.png"1067 }1068 },1069 "bookmarks": []1070 },1071 {1072 "post_stream": {1073 "posts": [1074 {1075 "id": 366631,1076 "name": "Anirban Nath",1077 "username": "Anirban_Nath",1078 "avatar_template": "/user_avatar/discuss.pytorch.org/anirban_nath/{size}/47522_2.png",1079 "created_at": "2022-09-18T13:19:30.170Z",1080 "cooked": "<p>In my code, I have defined privacy engine as follows: -</p>\n<pre><code class=\"lang-auto\">unet, optimizer, trainloader = privacy_engine.make_private_with_epsilon(\n module = unet,\n data_loader = trainloader,\n optimizer = optimizer,\n epochs = global_epochs * local_epochs,\n target_epsilon = 1.0,\n batch_first = True,\n target_delta = PRIVACY_PARAMS['target_delta'],\n max_grad_norm = PRIVACY_PARAMS['max_grad_norm'])\n</code></pre>\n<p>I sampled a batch from the dataloader before and after passing through the privacy engine and every time I execute it, the wrapped dataloader shows some arbitrary batch size. For example, if my original dataloader was made with batch size =6, the wrapped dataloader shows 7, 10, etc, which changes with every execution. Why does this happen?</p>",1081 "post_number": 1,1082 "post_type": 1,1083 "posts_count": 5,1084 "updated_at": "2022-09-18T13:19:30.170Z",1085 "reply_count": 0,1086 "reply_to_post_number": null,1087 "quote_count": 0,1088 "incoming_link_count": 256,1089 "reads": 18,1090 "readers_count": 17,1091 "score": 1283.6,1092 "yours": false,1093 "topic_id": 161632,1094 "topic_slug": "arbitrary-batch-sizes-after-passing-dataloader-through-privacy-engine",1095 "display_username": "Anirban Nath",1096 "primary_group_name": null,1097 "flair_name": null,1098 "flair_url": null,1099 "flair_bg_color": null,1100 "flair_color": null,1101 "flair_group_id": null,1102 "badges_granted": [],1103 "version": 1,1104 "can_edit": false,1105 "can_delete": false,1106 "can_recover": false,1107 "can_see_hidden_post": false,1108 "can_wiki": false,1109 "read": true,1110 "user_title": null,1111 "bookmarked": false,1112 "actions_summary": [],1113 "moderator": false,1114 "admin": false,1115 "staff": false,1116 "user_id": 54029,1117 "hidden": false,1118 "trust_level": 1,1119 "deleted_at": null,1120 "user_deleted": false,1121 "edit_reason": null,1122 "can_view_edit_history": true,1123 "wiki": false,1124 "post_url": "/t/arbitrary-batch-sizes-after-passing-dataloader-through-privacy-engine/161632/1",1125 "can_accept_answer": false,1126 "can_unaccept_answer": false,1127 "accepted_answer": false,1128 "topic_accepted_answer": null,1129 "can_vote": false1130 },1131 {1132 "id": 366809,1133 "name": "Karthik Prasad",1134 "username": "karthikprasad",1135 "avatar_template": "/user_avatar/discuss.pytorch.org/karthikprasad/{size}/32155_2.png",1136 "created_at": "2022-09-19T23:12:43.885Z",1137 "cooked": "<p>Hello <a class=\"mention\" href=\"/u/anirban_nath\">@Anirban_Nath</a>,<br>\nThis is a consequence of using Poisson sampling that is needed for a Differentially Private Data Loader. This has been called out in the doc strings here (<a href=\"https://opacus.ai/api/data_loader.html\" class=\"inline-onebox\" rel=\"noopener nofollow ugc\">Opacus · Train PyTorch models with Differential Privacy</a>). I’ll make sure this also captured in our FAQs at <a href=\"https://opacus.ai/docs/faq\" class=\"inline-onebox\" rel=\"noopener nofollow ugc\">FAQ · Opacus</a></p>\n<p>[Tracking the update to documentation at <a href=\"https://github.com/pytorch/opacus/issues/514\" class=\"inline-onebox\" rel=\"noopener nofollow ugc\">Add an FAQ about variable batch size · Issue #514 · pytorch/opacus · GitHub</a>]</p>",1138 "post_number": 2,1139 "post_type": 1,1140 "posts_count": 5,1141 "updated_at": "2022-09-19T23:18:06.948Z",1142 "reply_count": 1,1143 "reply_to_post_number": null,1144 "quote_count": 0,1145 "incoming_link_count": 1,1146 "reads": 17,1147 "readers_count": 16,1148 "score": 13.4,1149 "yours": false,1150 "topic_id": 161632,1151 "topic_slug": "arbitrary-batch-sizes-after-passing-dataloader-through-privacy-engine",1152 "display_username": "Karthik Prasad",1153 "primary_group_name": null,1154 "flair_name": null,1155 "flair_url": null,1156 "flair_bg_color": null,1157 "flair_color": null,1158 "flair_group_id": null,1159 "badges_granted": [],1160 "version": 2,1161 "can_edit": false,1162 "can_delete": false,1163 "can_recover": false,1164 "can_see_hidden_post": false,1165 "can_wiki": false,1166 "link_counts": [1167 {1168 "url": "https://opacus.ai/api/data_loader.html",1169 "internal": false,1170 "reflection": false,1171 "title": "Opacus · Train PyTorch models with Differential Privacy",1172 "clicks": 171173 },1174 {1175 "url": "https://github.com/pytorch/opacus/issues/514",1176 "internal": false,1177 "reflection": false,1178 "title": "Add an FAQ about variable batch size · Issue #514 · pytorch/opacus · GitHub",1179 "clicks": 61180 },1181 {1182 "url": "https://opacus.ai/docs/faq",1183 "internal": false,1184 "reflection": false,1185 "title": "FAQ · Opacus",1186 "clicks": 31187 }1188 ],1189 "read": true,1190 "user_title": null,1191 "bookmarked": false,1192 "actions_summary": [],1193 "moderator": false,1194 "admin": false,1195 "staff": false,1196 "user_id": 39902,1197 "hidden": false,1198 "trust_level": 2,1199 "deleted_at": null,1200 "user_deleted": false,