Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 342996,7 "name": "Waqas Sheikh",8 "username": "Waqas_Sheikh",9 "avatar_template": "/user_avatar/discuss.pytorch.org/waqas_sheikh/{size}/45530_2.png",10 "created_at": "2022-04-24T20:12:27.092Z",11 "cooked": "<p>When I run the following code with one layer network it works well. However, When I switch to two layer network it generates the Following Error. Can Some help me resolve the issue. The code is cloned from the following GitHub Repo.</p><aside class=\"onebox allowlistedgeneric\" data-onebox-src=\"https://github.com/amina01/ESMIL\">\n <header class=\"source\">\n <img src=\"https://github.githubassets.com/favicons/favicon.svg\" class=\"site-icon\" width=\"32\" height=\"32\">\n\n <a href=\"https://github.com/amina01/ESMIL\" target=\"_blank\" rel=\"noopener nofollow ugc\">GitHub</a>\n </header>\n\n <article class=\"onebox-body\">\n <div class=\"aspect-image\" style=\"--aspect-ratio:690/344;\"><img src=\"https://opengraph.githubassets.com/3af2046449f644d3ad11c435c29121b4257bd5af43fe77a8a7a526c2a285401b/amina01/ESMIL\" class=\"thumbnail\" width=\"690\" height=\"345\"></div>\n\n<h3><a href=\"https://github.com/amina01/ESMIL\" target=\"_blank\" rel=\"noopener nofollow ugc\">GitHub - amina01/ESMIL: An embarrassingly simple approach to neural multiple...</a></h3>\n\n <p>An embarrassingly simple approach to neural multiple instance classification - GitHub - amina01/ESMIL: An embarrassingly simple approach to neural multiple instance classification</p>\n\n\n </article>\n\n <div class=\"onebox-metadata\">\n \n \n </div>\n\n <div style=\"clear: both\"></div>\n</aside>\n\n<p>Thanks</p>\n<blockquote>\n<p>RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [230, 1]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).</p>\n</blockquote>\n<blockquote>\n<h1>-<em>- coding: utf-8 -</em>-</h1>\n<p>“”\"<br>\nCreated on Fri Feb 22 16:24:22 2019<br>\n<span class=\"mention\">@author</span>: Amina<br>\nThe following code is for one ten fold cross validation run of neural MIL on Tiger dataset.<br>\nBy default it runs for Single layer architecture.<br>\n“”\"</p>\n<p>import torch.nn as nn<br>\nimport torch.nn.functional as F<br>\nimport torch.optim as optim<br>\nfrom torch.autograd import Variable<br>\nimport torch</p>\n<p>import numpy as np<br>\nfrom torch.utils.data import Dataset, DataLoader<br>\nfrom sklearn.metrics import roc_auc_score as auc_roc<br>\nfrom sklearn import metrics<br>\nimport <a href=\"http://scipy.io\" rel=\"noopener nofollow ugc\">scipy.io</a><br>\nfrom sklearn.model_selection import StratifiedKFold</p>\n<p>class MyDataset(Dataset):<br>\ndef <strong>init</strong>(self, bags):<br>\nself.bags = bags</p>\n<pre><code>def __getitem__(self, index):\n examples = self.bags[index]\n return examples\n \ndef __len__(self):\n return len(self.bags)\n</code></pre>\n<p>‘’’<br>\nSingle Layer Architecture<br>\n‘’’</p>\n<p>class Net(nn.Module):<br>\ndef <strong>init</strong>(self,d):<br>\nsuper(Net, self).<strong>init</strong>()<br>\nself.out = nn.Linear(d,1)</p>\n<pre><code>def forward(self,x):\n x = x.view(x.size(0), -1)\n x = self.out(x)\n return x\n</code></pre>\n<p>‘’’<br>\nOne Hidden Layer Architecture<br>\n‘’’</p>\n<h1></h1>\n<p><span class=\"hashtag-raw\">#class</span> Net(nn.Module):</p>\n<h1>def <strong>init</strong>(self,d):</h1>\n<h1>super(Net, self).<strong>init</strong>()</h1>\n<h1>self.hidden1 = nn.Linear(d,d)</h1>\n<h1>self.out = nn.Linear(d,1)</h1>\n<h1></h1>\n<h1>def forward(self,x):</h1>\n<h1>x = x.view(x.size(0), -1)</h1>\n<h1>x = self.hidden1(x)</h1>\n<h1>x = F.tanh(x)</h1>\n<h1></h1>\n<h1>x = self.out(x)</h1>\n<h1>return x</h1>\n<p>def create_bags_mat(path=‘data\\elephant_100x100_matlab.mat’):<br>\nmat=scipy.io.loadmat(path)<br>\nids=mat[‘bag_ids’][0]<br>\nf=scipy.sparse.csr_matrix.todense(mat[‘features’])<br>\nl=np.array(scipy.sparse.csr_matrix.todense(mat[‘labels’]))[0]<br>\nbags=<span class=\"chcklst-box fa fa-square-o fa-fw\"></span><br>\nlabels=<span class=\"chcklst-box fa fa-square-o fa-fw\"></span><br>\nfor i in set(ids):<br>\nbags.append(np.array(f[ids==i]))<br>\nlabels.append(l[ids==i][0])<br>\nbags=np.array(bags)<br>\nlabels=np.array(labels)<br>\nreturn bags, labels</p>\n<p>aucs=<span class=\"chcklst-box fa fa-square-o fa-fw\"></span><br>\naccs=<span class=\"chcklst-box fa fa-square-o fa-fw\"></span><br>\nbags, labels=create_bags_mat()</p>\n<p>skf = StratifiedKFold(n_splits=10)<br>\nfor train, test in skf.split(bags, labels):</p>\n<pre><code>bags_tr=bags[train]\ny_tr=labels[train]\nbags_ts=bags[test]\ny_ts=labels[test]\npos_bags=bags_tr[y_tr>0]\nneg_bags=bags_tr[y_tr<0]\n\n\n\npos=MyDataset(pos_bags)\nneg=MyDataset(neg_bags)\n\nloader_pos = DataLoader(pos, batch_size=1)\nloader_neg = DataLoader(neg, batch_size=1)\nepochs=10\nmlp=Net(230)\nmlp.cuda()\n</code></pre>\n<h1>torch.set_default_tensor_type(‘torch.cuda.FloatTensor’)</h1>\n<pre><code>optimizer = optim.Adam(mlp.parameters())\n\nall_losses=[]\nfor e in range(epochs):\n l=0.0\n for idx_p, pbag in enumerate(loader_pos):\n pbag=pbag.float()\n pbag=Variable(pbag).type(torch.cuda.FloatTensor)\n p_scores=mlp.forward(pbag[0])\n max_p=torch.max(p_scores)\n\n for idx_n, nbag in enumerate(loader_neg):\n nbag=nbag.float()\n nbag=Variable(nbag).type(torch.cuda.FloatTensor)\n n_scores=mlp.forward(nbag[0])\n\n max_n=torch.max(n_scores)\n z=np.array([0.0])\n loss=torch.max(Variable(torch.from_numpy(z)).type(torch.cuda.FloatTensor), (max_n-max_p+1))\n</code></pre>\n<h1>loss=torch.max(torch.tensor(0.0), (max_n-max_p+1))</h1>\n<pre><code> l=l+float(loss)\n\n optimizer.zero_grad()\n loss.backward(retain_graph=True)\n\n optimizer.step()\n all_losses.append(l)\n#testing\n\ntest=MyDataset(bags_ts)\nloader_ts=DataLoader(test, batch_size=1)\npredictions=[]\n\nfor param in mlp.parameters():\n param.requires_grad =False\nfor idx_ts, tsbag in enumerate(loader_ts):\n tsbag=tsbag.float()\n tsbag=Variable(tsbag).type(torch.cuda.FloatTensor)\n scores=mlp.forward(tsbag[0])\n\n predictions.append(float(torch.max(scores)))\nauc=auc_roc(y_ts, predictions)\naucs.append(auc)\nprint ('AUC=',auc)\n\n\nf, t, a=metrics.roc_curve(y_ts, predictions)\nAN=sum(x<0 for x in y_ts)\nAP=sum(x>0 for x in y_ts)\nTN=(1.0-f)*AN\nTP=t*AP\nAcc2=(TP+TN)/len(y_ts)\nacc=max(Acc2)\nprint ('accuracy=',acc )\naccs.append(acc)\n</code></pre>\n<p>print (“\\n\\nmean auc=”, np.mean(aucs))<br>\nprint (“mean acc=”, np.mean(accs))</p>\n</blockquote>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 3,15 "updated_at": "2022-04-24T20:12:27.092Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 128,20 "reads": 9,21 "readers_count": 8,22 "score": 641.8,23 "yours": false,24 "topic_id": 149962,25 "topic_slug": "inplace-operation-error-for-simple-addition-and-subtraction-operations",26 "display_username": "Waqas Sheikh",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://github.com/amina01/ESMIL",43 "internal": false,44 "reflection": false,45 "title": "GitHub - amina01/ESMIL: An embarrassingly simple approach to neural multiple instance classification",46 "clicks": 247 },48 {49 "url": "http://scipy.io",50 "internal": false,51 "reflection": false,52 "clicks": 053 }54 ],55 "read": true,56 "user_title": null,57 "bookmarked": false,58 "actions_summary": [],59 "moderator": false,60 "admin": false,61 "staff": false,62 "user_id": 55321,63 "hidden": false,64 "trust_level": 0,65 "deleted_at": null,66 "user_deleted": false,67 "edit_reason": null,68 "can_view_edit_history": true,69 "wiki": false,70 "post_url": "/t/inplace-operation-error-for-simple-addition-and-subtraction-operations/149962/1",71 "can_accept_answer": false,72 "can_unaccept_answer": false,73 "accepted_answer": false,74 "topic_accepted_answer": null,75 "can_vote": false76 },77 {78 "id": 343033,79 "name": "",80 "username": "pks",81 "avatar_template": "/user_avatar/discuss.pytorch.org/pks/{size}/48954_2.png",82 "created_at": "2022-04-25T04:31:11.175Z",83 "cooked": "<p>i am facing similar issues as well, tried clone() and other solutions suggested, but nothing seems to work.</p>",84 "post_number": 2,85 "post_type": 1,86 "posts_count": 3,87 "updated_at": "2022-04-25T04:31:11.175Z",88 "reply_count": 0,89 "reply_to_post_number": null,90 "quote_count": 0,91 "incoming_link_count": 1,92 "reads": 7,93 "readers_count": 6,94 "score": 6.4,95 "yours": false,96 "topic_id": 149962,97 "topic_slug": "inplace-operation-error-for-simple-addition-and-subtraction-operations",98 "display_username": "",99 "primary_group_name": null,100 "flair_name": null,101 "flair_url": null,102 "flair_bg_color": null,103 "flair_color": null,104 "flair_group_id": null,105 "badges_granted": [],106 "version": 1,107 "can_edit": false,108 "can_delete": false,109 "can_recover": false,110 "can_see_hidden_post": false,111 "can_wiki": false,112 "read": true,113 "user_title": null,114 "bookmarked": false,115 "actions_summary": [],116 "moderator": false,117 "admin": false,118 "staff": false,119 "user_id": 55332,120 "hidden": false,121 "trust_level": 1,122 "deleted_at": null,123 "user_deleted": false,124 "edit_reason": null,125 "can_view_edit_history": true,126 "wiki": false,127 "post_url": "/t/inplace-operation-error-for-simple-addition-and-subtraction-operations/149962/2",128 "can_accept_answer": false,129 "can_unaccept_answer": false,130 "accepted_answer": false,131 "topic_accepted_answer": null132 },133 {134 "id": 343257,135 "name": "Zheng_An Zhu",136 "username": "Zheng_An_Zhu",137 "avatar_template": "/user_avatar/discuss.pytorch.org/zheng_an_zhu/{size}/48727_2.png",138 "created_at": "2022-04-26T08:57:39.721Z",139 "cooked": "<p>I add a copy model to deal with <code>p_scores</code> forward process and it works to me in your two layers network.<br>\nI have no idea about why original code works in single fc layer, sorry.</p>\n<p>New version (related by <a href=\"https://discuss.pytorch.org/t/solved-pytorch1-5-runtimeerror-one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation/90256/22\">here</a>):</p>\n<pre><code class=\"lang-auto\">mlp_new = deepcopy(mlp)\np_scores=mlp_new.forward(pbag[0])\n</code></pre>",140 "post_number": 3,141 "post_type": 1,142 "posts_count": 3,143 "updated_at": "2022-04-26T09:21:24.421Z",144 "reply_count": 0,145 "reply_to_post_number": null,146 "quote_count": 0,147 "incoming_link_count": 3,148 "reads": 6,149 "readers_count": 5,150 "score": 16.2,151 "yours": false,152 "topic_id": 149962,153 "topic_slug": "inplace-operation-error-for-simple-addition-and-subtraction-operations",154 "display_username": "Zheng_An Zhu",155 "primary_group_name": null,156 "flair_name": null,157 "flair_url": null,158 "flair_bg_color": null,159 "flair_color": null,160 "flair_group_id": null,161 "badges_granted": [],162 "version": 2,163 "can_edit": false,164 "can_delete": false,165 "can_recover": false,166 "can_see_hidden_post": false,167 "can_wiki": false,168 "link_counts": [169 {170 "url": "https://discuss.pytorch.org/t/solved-pytorch1-5-runtimeerror-one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation/90256/22",171 "internal": true,172 "reflection": false,173 "title": "[Solved][Pytorch1.5] RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation",174 "clicks": 4175 }176 ],177 "read": true,178 "user_title": null,179 "bookmarked": false,180 "actions_summary": [],181 "moderator": false,182 "admin": false,183 "staff": false,184 "user_id": 55092,185 "hidden": false,186 "trust_level": 1,187 "deleted_at": null,188 "user_deleted": false,189 "edit_reason": null,190 "can_view_edit_history": true,191 "wiki": false,192 "post_url": "/t/inplace-operation-error-for-simple-addition-and-subtraction-operations/149962/3",193 "can_accept_answer": false,194 "can_unaccept_answer": false,195 "accepted_answer": false,196 "topic_accepted_answer": null197 }198 ],199 "stream": [200 342996,201 343033,202 343257203 ]204 },205 "timeline_lookup": [206 [207 1,208 1280209 ],210 [211 3,212 1278213 ]214 ],215 "suggested_topics": [216 {217 "fancy_title": "CUDA memory issue in Hessian vector product",218 "id": 217964,219 "title": "CUDA memory issue in Hessian vector product",220 "slug": "cuda-memory-issue-in-hessian-vector-product",221 "posts_count": 1,222 "reply_count": 0,223 "highest_post_number": 1,224 "image_url": null,225 "created_at": "2025-03-17T23:50:00.337Z",226 "last_posted_at": "2025-03-17T23:50:00.373Z",227 "bumped": true,228 "bumped_at": "2025-03-17T23:56:25.366Z",229 "archetype": "regular",230 "unseen": false,231 "pinned": false,232 "unpinned": null,233 "visible": true,234 "closed": false,235 "archived": false,236 "bookmarked": null,237 "liked": null,238 "tags_descriptions": {},239 "like_count": 0,240 "views": 44,241 "category_id": 7,242 "featured_link": null,243 "has_accepted_answer": false,244 "posters": [245 {246 "extras": "latest single",247 "description": "Original Poster, Most Recent Poster",248 "user": {249 "id": 83335,250 "username": "CheukHinHoJerry",251 "name": "Cheuk Hin Ho",252 "avatar_template": "/user_avatar/discuss.pytorch.org/cheukhinhojerry/{size}/76219_2.png",253 "trust_level": 1254 }255 }256 ]257 },258 {259 "fancy_title": "Get softmax_lse value for sdpa kernel?",260 "id": 218079,261 "title": "Get softmax_lse value for sdpa kernel?",262 "slug": "get-softmax-lse-value-for-sdpa-kernel",263 "posts_count": 1,264 "reply_count": 0,265 "highest_post_number": 1,266 "image_url": null,267 "created_at": "2025-03-20T14:59:54.746Z",268 "last_posted_at": "2025-03-20T14:59:54.784Z",269 "bumped": true,270 "bumped_at": "2025-03-20T14:59:54.784Z",271 "archetype": "regular",272 "unseen": false,273 "pinned": false,274 "unpinned": null,275 "visible": true,276 "closed": false,277 "archived": false,278 "bookmarked": null,279 "liked": null,280 "tags_descriptions": {},281 "like_count": 0,282 "views": 74,283 "category_id": 7,284 "featured_link": null,285 "has_accepted_answer": false,286 "posters": [287 {288 "extras": "latest single",289 "description": "Original Poster, Most Recent Poster",290 "user": {291 "id": 83386,292 "username": "barpitf",293 "name": "barpitf",294 "avatar_template": "/letter_avatar_proxy/v4/letter/b/dfb087/{size}.png",295 "trust_level": 1296 }297 }298 ]299 },300 {301 "fancy_title": "Why the gradient values seems to be reversed in Tensor.backward()",302 "id": 214889,303 "title": "Why the gradient values seems to be reversed in Tensor.backward()",304 "slug": "why-the-gradient-values-seems-to-be-reversed-in-tensor-backward",305 "posts_count": 10,306 "reply_count": 8,307 "highest_post_number": 10,308 "image_url": null,309 "created_at": "2025-01-02T13:55:38.988Z",310 "last_posted_at": "2025-01-02T23:05:59.419Z",311 "bumped": true,312 "bumped_at": "2025-01-02T23:05:59.419Z",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": 53,325 "category_id": 7,326 "featured_link": null,327 "has_accepted_answer": true,328 "posters": [329 {330 "extras": "latest",331 "description": "Original Poster, Most Recent Poster",332 "user": {333 "id": 81838,334 "username": "nadeeer",335 "name": "Nadeeer",336 "avatar_template": "/user_avatar/discuss.pytorch.org/nadeeer/{size}/74863_2.png",337 "trust_level": 0338 }339 },340 {341 "extras": null,342 "description": "Frequent Poster, Accepted Answer",343 "user": {344 "id": 41396,345 "username": "soulitzer",346 "name": "",347 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",348 "trust_level": 2349 }350 }351 ]352 },353 {354 "fancy_title": "Gradcheck fails for custom activation function",355 "id": 215759,356 "title": "Gradcheck fails for custom activation function",357 "slug": "gradcheck-fails-for-custom-activation-function",358 "posts_count": 4,359 "reply_count": 1,360 "highest_post_number": 4,361 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/6/0/60b680d7b8316018ecfc2627105a87417a4ab7ec_2_1024x739.png",362 "created_at": "2025-01-23T10:56:32.694Z",363 "last_posted_at": "2025-01-26T18:38:51.403Z",364 "bumped": true,365 "bumped_at": "2025-01-26T18:38:51.403Z",366 "archetype": "regular",367 "unseen": false,368 "pinned": false,369 "unpinned": null,370 "visible": true,371 "closed": false,372 "archived": false,373 "bookmarked": null,374 "liked": null,375 "tags_descriptions": {},376 "like_count": 1,377 "views": 104,378 "category_id": 7,379 "featured_link": null,380 "has_accepted_answer": true,381 "posters": [382 {383 "extras": "latest",384 "description": "Original Poster, Most Recent Poster, Accepted Answer",385 "user": {386 "id": 82259,387 "username": "anirudh_puligandla",388 "name": "anirudh puligandla",389 "avatar_template": "/user_avatar/discuss.pytorch.org/anirudh_puligandla/{size}/75256_2.png",390 "trust_level": 1391 }392 },393 {394 "extras": null,395 "description": "Frequent Poster",396 "user": {397 "id": 41396,398 "username": "soulitzer",399 "name": "",400 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",401 "trust_level": 2402 }403 }404 ]405 },406 {407 "fancy_title": "Most efficient way to re-use grad computations in a layer which is a linear combination of linear layers",408 "id": 219274,409 "title": "Most efficient way to re-use grad computations in a layer which is a linear combination of linear layers",410 "slug": "most-efficient-way-to-re-use-grad-computations-in-a-layer-which-is-a-linear-combination-of-linear-layers",411 "posts_count": 3,412 "reply_count": 0,413 "highest_post_number": 3,414 "image_url": null,415 "created_at": "2025-04-20T17:22:38.368Z",416 "last_posted_at": "2025-04-20T17:48:15.387Z",417 "bumped": true,418 "bumped_at": "2025-04-20T18:24:07.162Z",419 "archetype": "regular",420 "unseen": false,421 "pinned": false,422 "unpinned": null,423 "visible": true,424 "closed": false,425 "archived": false,426 "bookmarked": null,427 "liked": null,428 "tags_descriptions": {},429 "like_count": 0,430 "views": 53,431 "category_id": 7,432 "featured_link": null,433 "has_accepted_answer": false,434 "posters": [435 {436 "extras": "latest",437 "description": "Original Poster, Most Recent Poster",438 "user": {439 "id": 83919,440 "username": "nikitaved",441 "name": "Nikitaved",442 "avatar_template": "/user_avatar/discuss.pytorch.org/nikitaved/{size}/76721_2.png",443 "trust_level": 1444 }445 },446 {447 "extras": null,448 "description": "Frequent Poster",449 "user": {450 "id": 3534,451 "username": "ptrblck",452 "name": "",453 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",454 "admin": true,455 "moderator": true,456 "trust_level": 2457 }458 }459 ]460 }461 ],462 "tags_descriptions": {},463 "fancy_title": "Inplace operation Error for simple addition and Subtraction operations",464 "id": 149962,465 "title": "Inplace operation Error for simple addition and Subtraction operations",466 "posts_count": 3,467 "created_at": "2022-04-24T20:12:27.021Z",468 "views": 982,469 "reply_count": 0,470 "like_count": 0,471 "last_posted_at": "2022-04-26T08:57:39.721Z",472 "visible": true,473 "closed": false,474 "archived": false,475 "has_summary": false,476 "archetype": "regular",477 "slug": "inplace-operation-error-for-simple-addition-and-subtraction-operations",478 "category_id": 7,479 "word_count": 755,480 "deleted_at": null,481 "user_id": 55321,482 "featured_link": null,483 "pinned_globally": false,484 "pinned_at": null,485 "pinned_until": null,486 "image_url": null,487 "slow_mode_seconds": 0,488 "draft": null,489 "draft_key": "topic_149962",490 "draft_sequence": null,491 "unpinned": null,492 "pinned": false,493 "current_post_number": 1,494 "highest_post_number": 3,495 "deleted_by": null,496 "actions_summary": [497 {498 "id": 4,499 "count": 0,500 "hidden": false,501 "can_act": false502 },503 {504 "id": 8,505 "count": 0,506 "hidden": false,507 "can_act": false508 },509 {510 "id": 10,511 "count": 0,512 "hidden": false,513 "can_act": false514 },515 {516 "id": 7,517 "count": 0,518 "hidden": false,519 "can_act": false520 }521 ],522 "chunk_size": 20,523 "bookmarked": false,524 "topic_timer": null,525 "message_bus_last_id": 0,526 "participant_count": 3,527 "show_read_indicator": false,528 "thumbnails": null,529 "slow_mode_enabled_until": null,530 "can_vote": false,531 "vote_count": 0,532 "user_voted": false,533 "discourse_zendesk_plugin_zendesk_id": null,534 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",535 "details": {536 "can_edit": false,537 "notification_level": 1,538 "participants": [539 {540 "id": 55092,541 "username": "Zheng_An_Zhu",542 "name": "Zheng_An Zhu",543 "avatar_template": "/user_avatar/discuss.pytorch.org/zheng_an_zhu/{size}/48727_2.png",544 "post_count": 1,545 "primary_group_name": null,546 "flair_name": null,547 "flair_url": null,548 "flair_color": null,549 "flair_bg_color": null,550 "flair_group_id": null,551 "trust_level": 1552 },553 {554 "id": 55321,555 "username": "Waqas_Sheikh",556 "name": "Waqas Sheikh",557 "avatar_template": "/user_avatar/discuss.pytorch.org/waqas_sheikh/{size}/45530_2.png",558 "post_count": 1,559 "primary_group_name": null,560 "flair_name": null,561 "flair_url": null,562 "flair_color": null,563 "flair_bg_color": null,564 "flair_group_id": null,565 "trust_level": 0566 },567 {568 "id": 55332,569 "username": "pks",570 "name": "",571 "avatar_template": "/user_avatar/discuss.pytorch.org/pks/{size}/48954_2.png",572 "post_count": 1,573 "primary_group_name": null,574 "flair_name": null,575 "flair_url": null,576 "flair_color": null,577 "flair_bg_color": null,578 "flair_group_id": null,579 "trust_level": 1580 }581 ],582 "created_by": {583 "id": 55321,584 "username": "Waqas_Sheikh",585 "name": "Waqas Sheikh",586 "avatar_template": "/user_avatar/discuss.pytorch.org/waqas_sheikh/{size}/45530_2.png"587 },588 "last_poster": {589 "id": 55092,590 "username": "Zheng_An_Zhu",591 "name": "Zheng_An Zhu",592 "avatar_template": "/user_avatar/discuss.pytorch.org/zheng_an_zhu/{size}/48727_2.png"593 },594 "links": [595 {596 "url": "https://discuss.pytorch.org/t/solved-pytorch1-5-runtimeerror-one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation/90256/22",597 "title": "[Solved][Pytorch1.5] RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation",598 "internal": true,599 "attachment": false,600 "reflection": false,601 "clicks": 4,602 "user_id": 55092,603 "domain": "discuss.pytorch.org",604 "root_domain": "pytorch.org"605 },606 {607 "url": "https://github.com/amina01/ESMIL",608 "title": "GitHub - amina01/ESMIL: An embarrassingly simple approach to neural multiple instance classification",609 "internal": false,610 "attachment": false,611 "reflection": false,612 "clicks": 2,613 "user_id": 55321,614 "domain": "github.com",615 "root_domain": "github.com"616 }617 ]618 },619 "bookmarks": []620 },621 {622 "post_stream": {623 "posts": [624 {625 "id": 342359,626 "name": "Jost",627 "username": "dejhost",628 "avatar_template": "/letter_avatar_proxy/v4/letter/d/e8c25b/{size}.png",629 "created_at": "2022-04-20T13:40:30.404Z",630 "cooked": "<p>I’m training a model that returns 2 parameters. These two parameters are used for classical image processing:</p>\n<ol>\n<li>a threshold for the kirsch-operator</li>\n<li>the number of iterations for billateral filter.</li>\n</ol>\n<p>The model trains using 300 representative images, along with both parameters that were manually determined.</p>\n<ul>\n<li>I am currently using resnet18. A convolutional regression model.</li>\n<li>The fully connected layer is changed to output 2 nodes.</li>\n<li>As loss function I’ve chosen is the mean squared loss.</li>\n<li>Reducelronplateau is used as a learning rate scheduler to minimize validation loss.</li>\n</ul>\n<p>Unfortunately, my validation-loss is stuck. It settles inbetween 2000 and 3000.</p>\n<p>Here are some of the things I tried:</p>\n<ol>\n<li>Experiment with different models, including resnet36 resnet50 vgg16 mobilenet.</li>\n<li>Resized and changed the batchsize.</li>\n<li>Multiple heads after the renset18 feature layer for both output and calculated loss, seperately for iteration and thresholding</li>\n<li>Ssingle output model for each threshold and iterations separately.</li>\n<li>Replaced RGB-images tried HSV-images.</li>\n</ol>\n<p>I’d really appreaciate suggestions on how to succeed. Thank you very much.</p>",631 "post_number": 1,632 "post_type": 1,633 "posts_count": 4,634 "updated_at": "2022-04-20T13:40:30.404Z",635 "reply_count": 0,636 "reply_to_post_number": null,637 "quote_count": 0,638 "incoming_link_count": 720,639 "reads": 26,640 "readers_count": 25,641 "score": 3605.2,642 "yours": false,643 "topic_id": 149656,644 "topic_slug": "loss-stuck-for-regression-model",645 "display_username": "Jost",646 "primary_group_name": null,647 "flair_name": null,648 "flair_url": null,649 "flair_bg_color": null,650 "flair_color": null,651 "flair_group_id": null,652 "badges_granted": [],653 "version": 1,654 "can_edit": false,655 "can_delete": false,656 "can_recover": false,657 "can_see_hidden_post": false,658 "can_wiki": false,659 "read": true,660 "user_title": null,661 "bookmarked": false,662 "actions_summary": [],663 "moderator": false,664 "admin": false,665 "staff": false,666 "user_id": 55146,667 "hidden": false,668 "trust_level": 0,669 "deleted_at": null,670 "user_deleted": false,671 "edit_reason": null,672 "can_view_edit_history": true,673 "wiki": false,674 "post_url": "/t/loss-stuck-for-regression-model/149656/1",675 "can_accept_answer": false,676 "can_unaccept_answer": false,677 "accepted_answer": false,678 "topic_accepted_answer": null,679 "can_vote": false680 },681 {682 "id": 342404,683 "name": "Juan Montesinos",684 "username": "JuanFMontesinos",685 "avatar_template": "/user_avatar/discuss.pytorch.org/juanfmontesinos/{size}/76115_2.png",686 "created_at": "2022-04-20T20:37:24.887Z",687 "cooked": "<p>No really clue but some suggestions:</p>\n<ul>\n<li>Do you know that the task is feasible? Can you estimate those numbers your self just from the image?</li>\n<li>Which kind of images are you using? 300 are very few images. Toy datasets (mnist or cifar) have already 60k images. Something more adequate could be using neural networks are feature extractors and then use classic tools like trees or regression models. Even training only some fully connected layers on top of that. However, retraining a res net seems overkilling it (and it’s probably overfitting)</li>\n<li>networks are not good at all for predicting “numbers”. For example, classification problems are not trained to predict an ID rather but to generate a probability vector of all the possible values. Segmentation predicts per-class binary masks, landmark estimation predicts gaussian distributions per node etcetera… Also, predicting unbounded values makes the training more unstable as losses can vary a lot. if your network predicts 100 but the result was 1000 the MSE is so huge and the lr is not adjusted for such big gradients compared to predicting 100 and 150.</li>\n</ul>\n<p>Hope it helps</p>",688 "post_number": 2,689 "post_type": 1,690 "posts_count": 4,691 "updated_at": "2022-04-20T20:37:24.887Z",692 "reply_count": 0,693 "reply_to_post_number": null,694 "quote_count": 0,695 "incoming_link_count": 2,696 "reads": 25,697 "readers_count": 24,698 "score": 30.0,699 "yours": false,700 "topic_id": 149656,701 "topic_slug": "loss-stuck-for-regression-model",702 "display_username": "Juan Montesinos",703 "primary_group_name": null,704 "flair_name": null,705 "flair_url": null,706 "flair_bg_color": null,707 "flair_color": null,708 "flair_group_id": null,709 "badges_granted": [],710 "version": 1,711 "can_edit": false,712 "can_delete": false,713 "can_recover": false,714 "can_see_hidden_post": false,715 "can_wiki": false,716 "read": true,717 "user_title": "",718 "bookmarked": false,719 "actions_summary": [720 {721 "id": 2,722 "count": 1723 }724 ],725 "moderator": false,726 "admin": false,727 "staff": false,728 "user_id": 9081,729 "hidden": false,730 "trust_level": 2,731 "deleted_at": null,732 "user_deleted": false,733 "edit_reason": null,734 "can_view_edit_history": true,735 "wiki": false,736 "post_url": "/t/loss-stuck-for-regression-model/149656/2",737 "can_accept_answer": false,738 "can_unaccept_answer": false,739 "accepted_answer": false,740 "topic_accepted_answer": null741 },742 {743 "id": 342512,744 "name": "Jost",745 "username": "dejhost",746 "avatar_template": "/letter_avatar_proxy/v4/letter/d/e8c25b/{size}.png",747 "created_at": "2022-04-21T12:35:37.997Z",748 "cooked": "<p>Hello Juan,</p>\n<p>thank you for your elaboration - most appreciated!<br>\nYes, the task is feasable. After some execising, I can estimate the numbers myself. Of course: there is always room for improvement after the first guess.</p>\n<p>The images come from high-resolution cameras (mirror-cameras). All taken under water. The two parameters are supposed the adapted the processing methods to the visibility conditions.</p>\n<p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://discuss.pytorch.org/uploads/default/original/3X/a/5/a54b7bffe1325eb97a1f92d2e9dd7b8c969ee0d2.jpeg\" data-download-href=\"https://discuss.pytorch.org/uploads/default/a54b7bffe1325eb97a1f92d2e9dd7b8c969ee0d2\" title=\"0008_DSC05002\"><img src=\"https://discuss.pytorch.org/uploads/default/optimized/3X/a/5/a54b7bffe1325eb97a1f92d2e9dd7b8c969ee0d2_2_690x460.jpeg\" alt=\"0008_DSC05002\" data-base62-sha1=\"nAgvrtvi0ObZoq2E3RF6Jkoed7s\" width=\"690\" height=\"460\" srcset=\"https://discuss.pytorch.org/uploads/default/optimized/3X/a/5/a54b7bffe1325eb97a1f92d2e9dd7b8c969ee0d2_2_690x460.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/a/5/a54b7bffe1325eb97a1f92d2e9dd7b8c969ee0d2_2_1035x690.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/a/5/a54b7bffe1325eb97a1f92d2e9dd7b8c969ee0d2_2_1380x920.jpeg 2x\" data-dominant-color=\"609D98\"><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\">0008_DSC05002</span><span class=\"informations\">1920×1281 24.7 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>\nOther than that, there is little variation in the content of the images. That’s why I believe that 300 (representative) images should be sufficient.</p>\n<p>I will do some more testing based on your input.<br>\nWould it make sense to post the source-code?</p>\n<p>Thank you once again for your response.</p>\n<p>Adding the code here:</p>\n<pre data-code-wrap=\"from\"><code class=\"lang-from\">import cv2\nfrom torch.utils.data import Dataset\nimport pandas as pd\nimport os\nimport glob\nfrom tqdm import tqdm\nfrom PIL import Image, ImageFilter\nimport random\nimport torch\nimport torch.nn as nn\nfrom torch.nn import MSELoss\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.data import DataLoader, random_split\nimport torchvision.transforms as transforms\nimport numpy as np\nimport torchvision.models as models\n# from torchsummary import summary\nfrom itertools import product, combinations\nfrom random import randint\nimport torch.nn.functional as F\ntorch.manual_seed(0)\ntorch.cuda.empty_cache()\nextensions = [\".jpg\", \".jpeg\", \".JPG\"]\n\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n# device = 'cpu'\n\nclass CardDataset(Dataset):\n def __init__(self, root_dir, data_file_path, transform=None):\n self.Df = pd.read_csv(data_file_path)\n print(self.Df)\n self.root_dir = root_dir\n self.transform = transform\n\n def __len__(self):\n return len(self.Df)\n\n def __getitem__(self, index):\n #img_path = os.path.join(self.root_dir, self.Df['Image Name'][index]+'.JPG') \n #print('type img_path orig: ', type(img_path))\n #print('img_path orig: ', img_path)\n\n img_path = [f for f in glob.glob(os.path.join(self.root_dir, self.Df['Image Name'][index]+'*'), recursive=True) if os.path.splitext(f)[1] in extensions]\n img_path = str(img_path)[2:-2]\n #print('type img_path new: ', type(img_path))\n #print('img_path new: ', img_path)\n\n img = Image.open(img_path)\n y_label = torch.tensor([float(self.Df['Iterations'][index]), float(self.Df['Threshold'][index])])\n # y_label = torch.tensor( [float(self.Df['Threshold'][index])])\n # img = Image.new('RGB',(400,200))\n # img.paste(im1,(0,0))\n # img.paste(im2,(200,0))\n # label = y_label.item()\n # print(label)\n if self.transform is not None:\n img = self.transform(img)\n\n # print(img.size)\n\n return img, y_label\n\ntransform_train = transforms.Compose(\n [\n transforms.ToTensor(),\n transforms.Resize((1024, 1024)),\n #transforms.RandomCrop(1024),\n # transforms.RandomRotation(180),\n # transforms.RandomPerspective(), \n # transforms.ColorJitter(saturation=(0.8, 1.3), contrast=(0.8, 1.4), brightness=(0.8, 1.25)),\n # transforms.RandomPerspective(distortion_scale=0.6, p=1.0)\n # transforms.Resize(300),\n # transforms.Normalize(mean=[0.485, 0.456, 0.406],\n # std=[0.229, 0.224, 0.225]),\n ]\n )\n\n\nnum_epochs = 600\nlearning_rate = 0.001\ntrain_CNN = False\nbatch_size = 16\nshuffle = True\npin_memory = True\nnum_workers = 2\nprint(learning_rate)\nprint(num_epochs)\n\ntrain_set = CardDataset('all_days','all_days.csv',transform=transform_train)\ntrain_set, validation_set = random_split(train_set, [int(0.85*len(train_set)), len(train_set)-int(0.85*len(train_set))])\n#validation_set = CardDataset(\"hologram_classifier_dataset_splitted\",'validation',transform=transform_val)\n# train_set, validation_set = torch.utils.data.random_split(dataset,[train_size, val_size], generator=torch.Generator().manual_seed(2))\ntrain_loader = DataLoader(dataset=train_set, shuffle=shuffle, batch_size=batch_size, num_workers=num_workers)\nvalidation_loader = DataLoader(dataset=validation_set, shuffle=shuffle, batch_size=batch_size, num_workers=num_workers)\nprint(len(train_set))\n\nclass parameter_model(torch.nn.Module):\n def __init__(self):\n super().__init__()\n self.Conv1 = torch.nn.Conv2d(3, 16, 3, padding = 'same')\n self.Conv2 = torch.nn.Conv2d(16, 32, 3, padding = 'same')\n self.Conv3 = torch.nn.Conv2d(32, 64, 3, padding = 'same')\n self.Conv4 = torch.nn.Conv2d(64, 128, 3, padding = 'same')\n self.pool = torch.nn.MaxPool2d(2,2)\n self.fc1 = torch.nn.Linear(in_features = 128, out_features = 64)\n self.fc2 = torch.nn.Linear(64, 2)\n self.adaptive_pool = torch.nn.AdaptiveAvgPool2d(output_size=(1, 1))\n\n def forward(self, x):\n x = self.pool(F.relu(self.Conv1(x)))\n x = self.pool(F.relu(self.Conv2(x)))\n x = self.pool(F.relu(self.Conv3(x)))\n x = self.pool(F.relu(self.Conv4(x)))\n x = self.adaptive_pool(x)\n x = torch.flatten(x, 1)\n x = F.relu(self.fc1(x))\n x = F.relu(self.fc2(x))\n return x\n\n\n\n\n# # ct =0\n# # # childern = model.children()\n# # # print(childern)\n# # for child in model.children():\n# # ct += 1\n# # # print(child)\n# # if ct < 10:\n# # for param in child.parameters():\n# # param.requires_grad = False\n# # # model.to(device)\n# # print(ct)\nmodel = parameter_model()\n# print(model)\n# from torch.nn.modules.conv import Conv2d\n# model = models.resnet18(pretrained=False)\n# model.fc = nn.Linear(in_features=512, out_features=1, bias=True)\n# print(model)\n\n\nif torch.cuda.is_available():\n model.to(device)\n# loss_weight = torch.Tensor([0.5, 1])\n# loss_weight = loss_weight.to(device)\ncriterion = MSELoss()\noptimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)\nscheduler = ReduceLROnPlateau(optimizer, 'min', patience=15)\n\ndef train():\n # % % time\n # keeping-track-of-losses\n \n for epoch in range(1, num_epochs + 1):\n # keep-track-of-training-and-validation-loss\n # train_loss = 0.0\n\n # training-the-model\n model.train()\n # i= 0\n total_loss = []\n\n for data, target in tqdm(train_loader):\n # print('yes')\n # i = i+1\n # print(i)\n # move-tensors-to-GPU\n optimizer.zero_grad()\n data = data.to(device)\n target = target.to(device)\n\n # target = target.long()\n # clear-the-gradients-of-all-optimized-variables\n \n # forward-pass: compute-predicted-outputs-by-passing-inputs-to-the-model\n output = model(data)\n \n # results = torch.max(output, 1).indices\n \n # calculate-the-batch-loss\n loss = criterion(output, target)\n # backward-pass: compute-gradient-of-the-loss-wrt-model-parameters\n loss.backward()\n # perform-a-ingle-optimization-step (parameter-update)\n optimizer.step()\n #perform learning rate scheduler step\n total_loss.append(loss)\n # update-training-loss\n # train_loss += loss.item() * data.size(0)\n val_loss = 0\n model.eval()\n with torch.no_grad():\n for data, target in tqdm(validation_loader):\n # print('yes')\n # i = i+1\n # print(i)\n # move-tensors-to-GPU\n \n data = data.to(device)\n target = target.to(device)\n\n # target = target.long()\n # clear-the-gradients-of-all-optimized-variables\n \n # forward-pass: compute-predicted-outputs-by-passing-inputs-to-the-model\n output = model(data)\n \n # results = torch.max(output, 1).indices\n \n # calculate-the-batch-loss\n loss = criterion(output, target)\n val_loss = val_loss + loss\n \n scheduler.step(val_loss) \n\n print(f'Epoch: {epoch}\\t Train Loss: {sum(total_loss)/len(train_loader)}\\t Validation Loss: {val_loss/len(validation_loader)}')\n torch.save(model.state_dict(), \"model_checkpoints/checkpoint_\" + str(epoch) + \".pth\")\nprint(learning_rate)\ntrain()```</code></pre>",749 "post_number": 3,750 "post_type": 1,751 "posts_count": 4,752 "updated_at": "2022-04-22T07:50:43.814Z",753 "reply_count": 1,754 "reply_to_post_number": null,755 "quote_count": 0,756 "incoming_link_count": 12,757 "reads": 22,758 "readers_count": 21,759 "score": 69.4,760 "yours": false,761 "topic_id": 149656,762 "topic_slug": "loss-stuck-for-regression-model",763 "display_username": "Jost",764 "primary_group_name": null,765 "flair_name": null,766 "flair_url": null,767 "flair_bg_color": null,768 "flair_color": null,769 "flair_group_id": null,770 "badges_granted": [],771 "version": 3,772 "can_edit": false,773 "can_delete": false,774 "can_recover": false,775 "can_see_hidden_post": false,776 "can_wiki": false,777 "link_counts": [778 {779 "url": "https://discuss.pytorch.org/uploads/default/original/3X/a/5/a54b7bffe1325eb97a1f92d2e9dd7b8c969ee0d2.jpeg",780 "internal": true,781 "reflection": false,782 "clicks": 0783 }784 ],785 "read": true,786 "user_title": null,787 "bookmarked": false,788 "actions_summary": [],789 "moderator": false,790 "admin": false,791 "staff": false,792 "user_id": 55146,793 "hidden": false,794 "trust_level": 0,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/loss-stuck-for-regression-model/149656/3",801 "can_accept_answer": false,802 "can_unaccept_answer": false,803 "accepted_answer": false,804 "topic_accepted_answer": null805 },806 {807 "id": 343242,808 "name": "Juan Montesinos",809 "username": "JuanFMontesinos",810 "avatar_template": "/user_avatar/discuss.pytorch.org/juanfmontesinos/{size}/76115_2.png",811 "created_at": "2022-04-26T07:32:17.732Z",812 "cooked": "<p>Hmmm the thing is I don’t know how difficult the task is.<br>\nI would tell you to try to find a network pretrained on similar images so that you can use the features (there should be challenges in kaggle or so).<br>\nIn the worst case use at least vision networks pretrained on imagenet.</p>\n<p>It would be nice if you could pose the whole problem in pytorch and apply the loss over the images directly. But seems diff</p>",813 "post_number": 4,814 "post_type": 1,815 "posts_count": 4,816 "updated_at": "2022-04-26T07:32:17.732Z",817 "reply_count": 0,818 "reply_to_post_number": 3,819 "quote_count": 0,820 "incoming_link_count": 13,821 "reads": 14,822 "readers_count": 13,823 "score": 67.8,824 "yours": false,825 "topic_id": 149656,826 "topic_slug": "loss-stuck-for-regression-model",827 "display_username": "Juan Montesinos",828 "primary_group_name": null,829 "flair_name": null,830 "flair_url": null,831 "flair_bg_color": null,832 "flair_color": null,833 "flair_group_id": null,834 "badges_granted": [],835 "version": 1,836 "can_edit": false,837 "can_delete": false,838 "can_recover": false,839 "can_see_hidden_post": false,840 "can_wiki": false,841 "read": true,842 "user_title": "",843 "reply_to_user": {844 "id": 55146,845 "username": "dejhost",846 "name": "Jost",847 "avatar_template": "/letter_avatar_proxy/v4/letter/d/e8c25b/{size}.png"848 },849 "bookmarked": false,850 "actions_summary": [],851 "moderator": false,852 "admin": false,853 "staff": false,854 "user_id": 9081,855 "hidden": false,856 "trust_level": 2,857 "deleted_at": null,858 "user_deleted": false,859 "edit_reason": null,860 "can_view_edit_history": true,861 "wiki": false,862 "post_url": "/t/loss-stuck-for-regression-model/149656/4",863 "can_accept_answer": false,864 "can_unaccept_answer": false,865 "accepted_answer": false,866 "topic_accepted_answer": null867 }868 ],869 "stream": [870 342359,871 342404,872 342512,873 343242874 ]875 },876 "timeline_lookup": [877 [878 1,879 1284880 ],881 [882 3,883 1283884 ],885 [886 4,887 1279888 ]889 ],890 "suggested_topics": [891 {892 "fancy_title": "Freezing Backbone and training the detection head using torchvision detection models",893 "id": 219246,894 "title": "Freezing Backbone and training the detection head using torchvision detection models",895 "slug": "freezing-backbone-and-training-the-detection-head-using-torchvision-detection-models",896 "posts_count": 1,897 "reply_count": 0,898 "highest_post_number": 1,899 "image_url": null,900 "created_at": "2025-04-19T09:30:56.403Z",901 "last_posted_at": "2025-04-19T09:30:56.446Z",902 "bumped": true,903 "bumped_at": "2025-04-19T09:30:56.446Z",904 "archetype": "regular",905 "unseen": false,906 "pinned": false,907 "unpinned": null,908 "visible": true,909 "closed": false,910 "archived": false,911 "bookmarked": null,912 "liked": null,913 "tags_descriptions": {},914 "like_count": 0,915 "views": 69,916 "category_id": 5,917 "featured_link": null,918 "has_accepted_answer": false,919 "posters": [920 {921 "extras": "latest single",922 "description": "Original Poster, Most Recent Poster",923 "user": {924 "id": 83897,925 "username": "Richie_1980",926 "name": "Richard Muscat",927 "avatar_template": "/user_avatar/discuss.pytorch.org/richie_1980/{size}/76705_2.png",928 "trust_level": 0929 }930 }931 ]932 },933 {934 "fancy_title": "Loss becomes constant afterwarmup?",935 "id": 219517,936 "title": "Loss becomes constant afterwarmup?",937 "slug": "loss-becomes-constant-afterwarmup",938 "posts_count": 2,939 "reply_count": 0,940 "highest_post_number": 2,941 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/d/6/d6075778b201d499c33037d473674dbaf8d2eec7_2_1024x320.png",942 "created_at": "2025-04-27T17:21:06.202Z",943 "last_posted_at": "2025-04-27T19:51:08.959Z",944 "bumped": true,945 "bumped_at": "2025-04-27T19:51:08.959Z",946 "archetype": "regular",947 "unseen": false,948 "pinned": false,949 "unpinned": null,950 "visible": true,951 "closed": false,952 "archived": false,953 "bookmarked": null,954 "liked": null,955 "tags_descriptions": {},956 "like_count": 0,957 "views": 67,958 "category_id": 5,959 "featured_link": null,960 "has_accepted_answer": false,961 "posters": [962 {963 "extras": null,964 "description": "Original Poster",965 "user": {966 "id": 81430,967 "username": "ecoArcGaming",968 "name": "",969 "avatar_template": "/user_avatar/discuss.pytorch.org/ecoarcgaming/{size}/74453_2.png",970 "trust_level": 1971 }972 },973 {974 "extras": "latest",975 "description": "Most Recent Poster",976 "user": {977 "id": 18088,978 "username": "KFrank",979 "name": "K. Frank",980 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",981 "trust_level": 2982 }983 }984 ]985 },986 {987 "fancy_title": "Gradient-like buffers for lines in images",988 "id": 213543,989 "title": "Gradient-like buffers for lines in images",990 "slug": "gradient-like-buffers-for-lines-in-images",991 "posts_count": 1,992 "reply_count": 0,993 "highest_post_number": 1,994 "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/b/c/bcc39b604f84752d479b43cbfa41683ef50dd1c4.png",995 "created_at": "2024-11-27T16:07:40.656Z",996 "last_posted_at": "2024-11-27T16:07:40.705Z",997 "bumped": true,998 "bumped_at": "2024-11-27T16:27:52.181Z",999 "archetype": "regular",1000 "unseen": false,1001 "pinned": false,1002 "unpinned": null,1003 "visible": true,1004 "closed": false,1005 "archived": false,1006 "bookmarked": null,1007 "liked": null,1008 "tags_descriptions": {},1009 "like_count": 0,1010 "views": 84,1011 "category_id": 5,1012 "featured_link": null,1013 "has_accepted_answer": false,1014 "posters": [1015 {1016 "extras": "latest single",1017 "description": "Original Poster, Most Recent Poster",1018 "user": {1019 "id": 67179,1020 "username": "ayoubft",1021 "name": "",1022 "avatar_template": "/user_avatar/discuss.pytorch.org/ayoubft/{size}/61489_2.png",1023 "trust_level": 11024 }1025 }1026 ]1027 },1028 {1029 "fancy_title": "Import torchvision fails on NVIDIA jetson orin nano",1030 "id": 217199,1031 "title": "Import torchvision fails on NVIDIA jetson orin nano",1032 "slug": "import-torchvision-fails-on-nvidia-jetson-orin-nano",1033 "posts_count": 3,1034 "reply_count": 1,1035 "highest_post_number": 4,1036 "image_url": null,1037 "created_at": "2025-02-26T18:34:09.423Z",1038 "last_posted_at": "2025-03-18T12:34:20.272Z",1039 "bumped": true,1040 "bumped_at": "2025-03-18T12:34:20.272Z",1041 "archetype": "regular",1042 "unseen": false,1043 "pinned": false,1044 "unpinned": null,1045 "visible": true,1046 "closed": false,1047 "archived": false,1048 "bookmarked": null,1049 "liked": null,1050 "tags_descriptions": {},1051 "like_count": 0,1052 "views": 222,1053 "category_id": 5,1054 "featured_link": null,1055 "has_accepted_answer": true,1056 "posters": [1057 {1058 "extras": "latest",1059 "description": "Original Poster, Most Recent Poster",1060 "user": {1061 "id": 35490,1062 "username": "cadip92",1063 "name": "Adwait Chandorkar",1064 "avatar_template": "/user_avatar/discuss.pytorch.org/cadip92/{size}/27771_2.png",1065 "trust_level": 11066 }1067 },1068 {1069 "extras": null,1070 "description": "Frequent Poster, Accepted Answer",1071 "user": {1072 "id": 77908,1073 "username": "mycul",1074 "name": "",1075 "avatar_template": "/user_avatar/discuss.pytorch.org/mycul/{size}/72394_2.png",1076 "trust_level": 21077 }1078 }1079 ]1080 },1081 {1082 "fancy_title": "Sort YoloPose detection using Tracker ID",1083 "id": 221474,1084 "title": "Sort YoloPose detection using Tracker ID",1085 "slug": "sort-yolopose-detection-using-tracker-id",1086 "posts_count": 2,1087 "reply_count": 0,1088 "highest_post_number": 2,1089 "image_url": null,1090 "created_at": "2025-07-12T17:23:26.556Z",1091 "last_posted_at": "2025-07-12T23:58:14.018Z",1092 "bumped": true,1093 "bumped_at": "2025-07-16T09:25:29.695Z",1094 "archetype": "regular",1095 "unseen": false,1096 "pinned": false,1097 "unpinned": null,1098 "visible": true,1099 "closed": false,1100 "archived": false,1101 "bookmarked": null,1102 "liked": null,1103 "tags_descriptions": {},1104 "like_count": 0,1105 "views": 57,1106 "category_id": 5,1107 "featured_link": null,1108 "has_accepted_answer": false,1109 "posters": [1110 {1111 "extras": null,1112 "description": "Original Poster",1113 "user": {1114 "id": 53578,1115 "username": "Miss_M",1116 "name": "CodeVision",1117 "avatar_template": "/letter_avatar_proxy/v4/letter/m/c5a1d2/{size}.png",1118 "trust_level": 01119 }1120 },1121 {1122 "extras": "latest",1123 "description": "Most Recent Poster",1124 "user": {1125 "id": 83318,1126 "username": "neonwatty",1127 "name": "Jeremy Watt",1128 "avatar_template": "/user_avatar/discuss.pytorch.org/neonwatty/{size}/76202_2.png",1129 "trust_level": 01130 }1131 }1132 ]1133 }1134 ],1135 "tags_descriptions": {},1136 "fancy_title": "Loss stuck for regression model",1137 "id": 149656,1138 "title": "Loss stuck for regression model",1139 "posts_count": 4,1140 "created_at": "2022-04-20T13:40:30.321Z",1141 "views": 1253,1142 "reply_count": 1,1143 "like_count": 1,1144 "last_posted_at": "2022-04-26T07:32:17.732Z",1145 "visible": true,1146 "closed": false,1147 "archived": false,1148 "has_summary": false,1149 "archetype": "regular",1150 "slug": "loss-stuck-for-regression-model",1151 "category_id": 5,1152 "word_count": 1452,1153 "deleted_at": null,1154 "user_id": 55146,1155 "featured_link": null,1156 "pinned_globally": false,1157 "pinned_at": null,1158 "pinned_until": null,1159 "image_url": null,1160 "slow_mode_seconds": 0,1161 "draft": null,1162 "draft_key": "topic_149656",1163 "draft_sequence": null,1164 "unpinned": null,1165 "pinned": false,1166 "current_post_number": 1,1167 "highest_post_number": 4,1168 "deleted_by": null,1169 "actions_summary": [1170 {1171 "id": 4,1172 "count": 0,1173 "hidden": false,1174 "can_act": false1175 },1176 {1177 "id": 8,1178 "count": 0,1179 "hidden": false,1180 "can_act": false1181 },1182 {1183 "id": 10,1184 "count": 0,1185 "hidden": false,1186 "can_act": false1187 },1188 {1189 "id": 7,1190 "count": 0,1191 "hidden": false,1192 "can_act": false1193 }1194 ],1195 "chunk_size": 20,1196 "bookmarked": false,1197 "topic_timer": null,1198 "message_bus_last_id": 0,1199 "participant_count": 2,1200 "show_read_indicator": false,