CoolFace
Datasetpublic

Anurag1734/cuda-error-resolution-analysis

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes7downloads
topics_batch_441.json61706 linesDownload Raw Back to raw
1[2  {3    "post_stream": {4      "posts": [5        {6          "id": 223372,7          "name": "Leo Frez",8          "username": "Leo_Frez",9          "avatar_template": "/user_avatar/discuss.pytorch.org/leo_frez/{size}/28083_2.png",10          "created_at": "2020-08-24T03:08:04.674Z",11          "cooked": "<p>Hello, there. I am trying to use this CNN code for img classifications. I am using 480x640 (height x length) images as input, also with its respectives 3 color channels. I adapted this code from a really famous online tutorial (shoutout to sentdex!) that was meant to process grayscale images, and it worked for me, although the accuracy was really bad, but i expected that since my classifications rely HARDLY on colors.</p>\n<p>The thing is, i got stuck on this this error, and i can’t seem to overcome this, since i am a COMPLETE newbie into this programming world, self taught and blablabla. So, take easy on me <img src=\"https://discuss.pytorch.org/images/emoji/apple/sweat_smile.png?v=9\" title=\":sweat_smile:\" class=\"emoji\" alt=\":sweat_smile:\"></p>\n<p>So, there is the code:</p>\n<pre><code class=\"lang-auto\">import os\nimport cv2\nimport numpy as np\nfrom tqdm import tqdm\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\n\nREBUILD_DATA = False # set to true to one once, then back to false unless you want to change something in your training data.\n\nif torch.cuda.is_available():\n    device = torch.device(\"cuda:0\")  # you can continue going on here, like cuda:1 cuda:2....etc. \n    print(\"Running on the GPU\")\nelse:\n    device = torch.device(\"cpu\")\n    print(\"Running on the CPU\")\n\nclass CornSeeds():\n    COB = \"C:/Users/leo_f/OneDrive/Imagens/MV/Cob\"\n    BROKEN = \"C:/Users/leo_f/OneDrive/Imagens/MV/Broken\"\n    ROTTEN = \"C:/Users/leo_f/OneDrive/Imagens/MV/Rotten\"\n    GOOD = \"C:/Users/leo_f/OneDrive/Imagens/MV/Good\"\n    TESTING = \"C:/Users/leo_f/OneDrive/Imagens/MV/Testing\"\n    LABELS = {COB: 0, BROKEN: 1, ROTTEN: 2, GOOD: 3}\n    training_data = []\n\n    cobcount = 0\n    brokencount = 0\n    rottencount = 0\n    goodcount = 0\n\n    def make_training_data(self):\n        for label in self.LABELS:\n            print(label)\n            for f in tqdm(os.listdir(label)):\n                if \"bmp\" in f:\n                    try:\n                        path = os.path.join(label, f)\n                        img = cv2.imread(path, cv2.IMREAD_UNCHANGED)\n                        self.training_data.append([np.array(img), np.eye(4)[self.LABELS[label]]])  # do something like print(np.eye(2)[1]), just makes one_hot \n                        #print(np.eye(2)[self.LABELS[label]])\n\n                        if label == self.COB:\n                            self.cobcount += 1\n                        elif label == self.BROKEN:\n                            self.brokencount += 1\n                        elif label == self.ROTTEN:\n                            self.rottencount += 1\n                        elif label == self.GOOD:\n                            self.goodcount += 1\n\n                    except Exception as e:\n                        pass\n                        #print(label, f, str(e))\n\n        np.random.shuffle(self.training_data)\n        np.save(\"training_data.npy\", self.training_data)\n        print('Cob:',cornseeds.cobcount)\n        print('Broken:',cornseeds.brokencount)\n        print('Rotten:',cornseeds.rottencount)\n        print('Good:',cornseeds.goodcount)\n\nif REBUILD_DATA:\n    cornseeds = CornSeeds()\n    cornseeds.make_training_data()\n\n\ntraining_data = np.load(\"training_data.npy\", allow_pickle=True)\nprint(len(training_data))\n\nclass Net(nn.Module):\n    def __init__(self):\n        super().__init__() # just run the init of parent class (nn.Module)\n        self.conv1 = nn.Conv2d(3, 128, 5) # input is 3 channels of an image, 128 output channels, 5x5 kernel / window\n        self.conv2 = nn.Conv2d(128, 256, 5) # input is 128, bc the first layer output 128. Then we say the output will be 256 channels, 5x5 kernel / window\n        self.conv3 = nn.Conv2d(256, 512, 5)\n\n        x = torch.randn(480, 640).view(-1, 3, 480, 640) # batch, channel, height, width\n        self._to_linear = None\n        self.convs(x)\n\n        self.fc1 = nn.Linear(self._to_linear, 512) #flattening.\n        self.fc2 = nn.Linear(512, 4) # 512 in, 4 out bc we're doing 4 classes.\n\n    def convs(self, x):\n        # max pooling over 2x2\n        x = F.max_pool2d(F.relu(self.conv1(x)), (2, 2))\n        x = F.max_pool2d(F.relu(self.conv2(x)), (2, 2))\n        x = F.max_pool2d(F.relu(self.conv3(x)), (2, 2))\n\n        if self._to_linear is None:\n            self._to_linear = np.prod(x[0].shape)\n        return x\n\n    def forward(self, x):\n        x = self.convs(x)\n        x = x.view(-1, self._to_linear)  # .view is reshape ... this flattens X before \n        x = F.relu(self.fc1(x))\n        x = self.fc2(x) # bc this is our output layer. No activation here.\n        return F.softmax(x, dim=1)\n\n\nnet = Net().to(device)\nprint(net)\n\nif REBUILD_DATA:\n    cornseeds = CornSeeds()\n    cornseeds.make_training_data()\n\ntraining_data = np.load(\"training_data.npy\", allow_pickle=True)\nprint(len(training_data))\n\noptimizer = optim.Adam(net.parameters(), lr=0.001)\nloss_function = nn.CrossEntropyLoss()\n\nX = torch.Tensor([i[0] for i in training_data]).view(-1, 3, 480, 640)\nX = X/255.0\ny = torch.Tensor([i[1] for i in training_data])\n\nVAL_PCT = 0.1  # lets reserve 10% of our data for validation\nval_size = int(len(X)*VAL_PCT)\n\ntrain_X = X[:-val_size]\ntrain_X.unsqueeze_(0)\ntrain_y = y[:-val_size]\n\n\ntest_X = X[-val_size:]\ntest_X.unsqueeze_(0)\ntest_y = y[-val_size:]\n\n\n\ndef train(net):\n    optimizer = optim.Adam(net.parameters(), lr=0.001)\n    BATCH_SIZE = 4\n    EPOCHS = 1\n    for epoch in range(EPOCHS):\n        for i in range(0, len(train_X), BATCH_SIZE): # from 0, to the len of x, stepping BATCH_SIZE at a time. [:50] ..for now just to dev\n            #print(f\"{i}:{i+BATCH_SIZE}\")\n            batch_X = train_X[i:i+BATCH_SIZE].view(-1, 3, 480, 640)\n            batch_y = train_y[i:i+BATCH_SIZE]\n\n            batch_X, batch_y = batch_X.to(device), batch_y.to(device)\n            net.zero_grad()\n\n            optimizer.zero_grad()   # zero the gradient buffers\n            outputs = net(batch_X)\n            loss = loss_function(outputs, batch_y)\n            loss.backward()\n            optimizer.step()    # Does the update\n\n        print(f\"Epoch: {epoch}. Loss: {loss}\")\n\n\ndef test(net):\n    correct = 0\n    total = 0\n    with torch.no_grad():\n        for i in tqdm(range(len(test_X))):\n            real_class = torch.argmax(test_y[i]).to(device)\n            net_out = net(test_X[i].view(-1, 1, 480, 640).to(device))[0]  # returns a list, \n            predicted_class = torch.argmax(net_out)\n\n            if predicted_class == real_class:\n                correct += 1\n            total += 1\n\n    print(\"Accuracy: \", round(correct/total, 3))\n\n    \ntrain(net)\ntest(net)\n</code></pre>\n<p>And this is the error i am getting:</p>\n<pre><code class=\"lang-auto\">---------------------------------------------------------------------------\nRuntimeError                              Traceback (most recent call last)\n&lt;ipython-input-46-1894121d00fb&gt; in &lt;module&gt;\n    103 \n    104 \n--&gt; 105 net = Net().to(device)\n    106 print(net)\n    107 \n\n&lt;ipython-input-46-1894121d00fb&gt; in __init__(self)\n     78         self.conv3 = nn.Conv2d(256, 512, 5)\n     79 \n---&gt; 80         x = torch.randn(480, 640).view(-1, 3, 480, 640) # batch, channel, height, width\n     81         self._to_linear = None\n     82         self.convs(x)\n\nRuntimeError: shape '[-1, 3, 480, 640]' is invalid for input of size 307200\n</code></pre>\n<p>Help me <img src=\"https://discuss.pytorch.org/images/emoji/apple/sob.png?v=9\" title=\":sob:\" class=\"emoji\" alt=\":sob:\"></p>",12          "post_number": 1,13          "post_type": 1,14          "posts_count": 3,15          "updated_at": "2020-08-24T11:55:02.088Z",16          "reply_count": 2,17          "reply_to_post_number": null,18          "quote_count": 0,19          "incoming_link_count": 1743,20          "reads": 16,21          "readers_count": 15,22          "score": 8693.2,23          "yours": false,24          "topic_id": 93849,25          "topic_slug": "runtimeerror-shape-1-3-480-640-is-invalid-for-input-of-size-307200",26          "display_username": "Leo Frez",27          "primary_group_name": null,28          "flair_name": null,29          "flair_url": null,30          "flair_bg_color": null,31          "flair_color": null,32          "flair_group_id": null,33          "badges_granted": [],34          "version": 3,35          "can_edit": false,36          "can_delete": false,37          "can_recover": false,38          "can_see_hidden_post": false,39          "can_wiki": false,40          "read": true,41          "user_title": null,42          "bookmarked": false,43          "actions_summary": [],44          "moderator": false,45          "admin": false,46          "staff": false,47          "user_id": 35867,48          "hidden": false,49          "trust_level": 1,50          "deleted_at": null,51          "user_deleted": false,52          "edit_reason": null,53          "can_view_edit_history": true,54          "wiki": false,55          "post_url": "/t/runtimeerror-shape-1-3-480-640-is-invalid-for-input-of-size-307200/93849/1",56          "can_accept_answer": false,57          "can_unaccept_answer": false,58          "accepted_answer": false,59          "topic_accepted_answer": true,60          "can_vote": false61        },62        {63          "id": 223531,64          "name": "",65          "username": "RaLo4",66          "avatar_template": "/letter_avatar_proxy/v4/letter/r/65b543/{size}.png",67          "created_at": "2020-08-24T12:08:59.283Z",68          "cooked": "<p>There’s a lot of weird things here, but to address the error you are getting:<br>\nThis particular error should be gone if you change this line:</p>\n<aside class=\"quote no-group\" data-username=\"Leo_Frez\" data-post=\"1\" data-topic=\"93849\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leo_frez/48/28083_2.png\" class=\"avatar\"> Leo_Frez:</div>\n<blockquote>\n<pre><code class=\"lang-auto\">x = torch.randn(480, 640).view(-1, 3, 480, 640) # batch, channel, height, width\n \n</code></pre>\n</blockquote>\n</aside>\n<p>To either this:</p>\n<pre><code class=\"lang-auto\">x = torch.randn(3, 480, 640).view(-1, 3, 480, 640) # batch, channel, height, width\n</code></pre>\n<p>Or this:</p>\n<pre><code class=\"lang-auto\">x = torch.randn(1, 3, 480, 640) # batch, channel, height, width\n</code></pre>",69          "post_number": 2,70          "post_type": 1,71          "posts_count": 3,72          "updated_at": "2020-08-25T02:37:36.709Z",73          "reply_count": 0,74          "reply_to_post_number": null,75          "quote_count": 1,76          "incoming_link_count": 11,77          "reads": 13,78          "readers_count": 12,79          "score": 72.6,80          "yours": false,81          "topic_id": 93849,82          "topic_slug": "runtimeerror-shape-1-3-480-640-is-invalid-for-input-of-size-307200",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": null,99          "bookmarked": false,100          "actions_summary": [101            {102              "id": 2,103              "count": 1104            }105          ],106          "moderator": false,107          "admin": false,108          "staff": false,109          "user_id": 34590,110          "hidden": false,111          "trust_level": 2,112          "deleted_at": null,113          "user_deleted": false,114          "edit_reason": null,115          "can_view_edit_history": true,116          "wiki": false,117          "post_url": "/t/runtimeerror-shape-1-3-480-640-is-invalid-for-input-of-size-307200/93849/2",118          "can_accept_answer": false,119          "can_unaccept_answer": false,120          "accepted_answer": true,121          "topic_accepted_answer": true122        },123        {124          "id": 223533,125          "name": "Usama Hasan",126          "username": "Usama_Hasan",127          "avatar_template": "/user_avatar/discuss.pytorch.org/usama_hasan/{size}/29254_2.png",128          "created_at": "2020-08-24T12:11:48.066Z",129          "cooked": "<p>Hy <a class=\"mention\" href=\"/u/leo_frez\">@Leo_Frez</a></p>\n<aside class=\"quote no-group\" data-username=\"Leo_Frez\" data-post=\"1\" data-topic=\"93849\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leo_frez/48/28083_2.png\" class=\"avatar\"> Leo_Frez:</div>\n<blockquote>\n<p><code>x = torch.randn(480, 640).view(-1, 3, 480, 640)</code></p>\n</blockquote>\n</aside>\n<p>So torch.randn(480,640) will generate a tensor of shape (480,640) right. further view(-1,3,480,640) will try to reshape it to array of size (3 * 480 * 640), so the size are not equal. That’s your immediate error.<br>\nWay around is</p>\n<pre><code class=\"lang-auto\">torch.randn(3,480,640).view(-1,3,480,640)\n</code></pre>",130          "post_number": 3,131          "post_type": 1,132          "posts_count": 3,133          "updated_at": "2020-08-24T12:11:48.066Z",134          "reply_count": 0,135          "reply_to_post_number": null,136          "quote_count": 1,137          "incoming_link_count": 11,138          "reads": 9,139          "readers_count": 8,140          "score": 71.8,141          "yours": false,142          "topic_id": 93849,143          "topic_slug": "runtimeerror-shape-1-3-480-640-is-invalid-for-input-of-size-307200",144          "display_username": "Usama Hasan",145          "primary_group_name": null,146          "flair_name": null,147          "flair_url": null,148          "flair_bg_color": null,149          "flair_color": null,150          "flair_group_id": null,151          "badges_granted": [],152          "version": 1,153          "can_edit": false,154          "can_delete": false,155          "can_recover": false,156          "can_see_hidden_post": false,157          "can_wiki": false,158          "read": true,159          "user_title": null,160          "bookmarked": false,161          "actions_summary": [162            {163              "id": 2,164              "count": 1165            }166          ],167          "moderator": false,168          "admin": false,169          "staff": false,170          "user_id": 34381,171          "hidden": false,172          "trust_level": 2,173          "deleted_at": null,174          "user_deleted": false,175          "edit_reason": null,176          "can_view_edit_history": true,177          "wiki": false,178          "post_url": "/t/runtimeerror-shape-1-3-480-640-is-invalid-for-input-of-size-307200/93849/3",179          "can_accept_answer": false,180          "can_unaccept_answer": false,181          "accepted_answer": false,182          "topic_accepted_answer": true183        }184      ],185      "stream": [186        223372,187        223531,188        223533189      ]190    },191    "timeline_lookup": [192      [193        1,194        1889195      ],196      [197        2,198        1888199      ]200    ],201    "suggested_topics": [202      {203        "fancy_title": "Gradient and the tensor dtype inconsistencies",204        "id": 219066,205        "title": "Gradient and the tensor dtype inconsistencies",206        "slug": "gradient-and-the-tensor-dtype-inconsistencies",207        "posts_count": 4,208        "reply_count": 1,209        "highest_post_number": 4,210        "image_url": null,211        "created_at": "2025-04-14T14:07:44.627Z",212        "last_posted_at": "2025-04-15T14:13:39.474Z",213        "bumped": true,214        "bumped_at": "2025-04-15T14:13:39.474Z",215        "archetype": "regular",216        "unseen": false,217        "pinned": false,218        "unpinned": null,219        "visible": true,220        "closed": false,221        "archived": false,222        "bookmarked": null,223        "liked": null,224        "tags_descriptions": {},225        "like_count": 0,226        "views": 126,227        "category_id": 5,228        "featured_link": null,229        "has_accepted_answer": false,230        "posters": [231          {232            "extras": null,233            "description": "Original Poster",234            "user": {235              "id": 29433,236              "username": "cltexe",237              "name": "Omer Faruk Soylemez",238              "avatar_template": "/user_avatar/discuss.pytorch.org/cltexe/{size}/41817_2.png",239              "trust_level": 1240            }241          },242          {243            "extras": null,244            "description": "Frequent Poster",245            "user": {246              "id": 77908,247              "username": "mycul",248              "name": "",249              "avatar_template": "/user_avatar/discuss.pytorch.org/mycul/{size}/72394_2.png",250              "trust_level": 2251            }252          },253          {254            "extras": "latest",255            "description": "Most Recent Poster",256            "user": {257              "id": 3534,258              "username": "ptrblck",259              "name": "",260              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",261              "admin": true,262              "moderator": true,263              "trust_level": 2264            }265          }266        ]267      },268      {269        "fancy_title": "ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided [&lsquo;pixel_values&rsquo;]",270        "id": 216220,271        "title": "ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['pixel_values']",272        "slug": "valueerror-you-should-supply-an-encoding-or-a-list-of-encodings-to-this-method-that-includes-input-ids-but-you-provided-pixel-values",273        "posts_count": 4,274        "reply_count": 1,275        "highest_post_number": 4,276        "image_url": null,277        "created_at": "2025-02-04T13:03:09.113Z",278        "last_posted_at": "2025-02-12T12:11:07.163Z",279        "bumped": true,280        "bumped_at": "2025-02-12T12:30:38.800Z",281        "archetype": "regular",282        "unseen": false,283        "pinned": false,284        "unpinned": null,285        "visible": true,286        "closed": false,287        "archived": false,288        "bookmarked": null,289        "liked": null,290        "tags_descriptions": {},291        "like_count": 0,292        "views": 445,293        "category_id": 5,294        "featured_link": null,295        "has_accepted_answer": false,296        "posters": [297          {298            "extras": "latest",299            "description": "Original Poster, Most Recent Poster",300            "user": {301              "id": 82473,302              "username": "milanalimova",303              "name": null,304              "avatar_template": "/user_avatar/discuss.pytorch.org/milanalimova/{size}/75456_2.png",305              "trust_level": 1306            }307          },308          {309            "extras": null,310            "description": "Frequent Poster",311            "user": {312              "id": 3534,313              "username": "ptrblck",314              "name": "",315              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",316              "admin": true,317              "moderator": true,318              "trust_level": 2319            }320          }321        ]322      },323      {324        "fancy_title": "Change vit_b_16 input size",325        "id": 214515,326        "title": "Change vit_b_16 input size",327        "slug": "change-vit-b-16-input-size",328        "posts_count": 2,329        "reply_count": 0,330        "highest_post_number": 2,331        "image_url": null,332        "created_at": "2024-12-21T18:00:08.693Z",333        "last_posted_at": "2024-12-21T19:00:07.503Z",334        "bumped": true,335        "bumped_at": "2024-12-21T19:00:07.503Z",336        "archetype": "regular",337        "unseen": false,338        "pinned": false,339        "unpinned": null,340        "visible": true,341        "closed": false,342        "archived": false,343        "bookmarked": null,344        "liked": null,345        "tags_descriptions": {},346        "like_count": 1,347        "views": 193,348        "category_id": 5,349        "featured_link": null,350        "has_accepted_answer": false,351        "posters": [352          {353            "extras": null,354            "description": "Original Poster",355            "user": {356              "id": 81646,357              "username": "bruhnugget-nice",358              "name": "bruhnugget",359              "avatar_template": "/user_avatar/discuss.pytorch.org/bruhnugget-nice/{size}/74667_2.png",360              "trust_level": 1361            }362          },363          {364            "extras": "latest",365            "description": "Most Recent Poster",366            "user": {367              "id": 3534,368              "username": "ptrblck",369              "name": "",370              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",371              "admin": true,372              "moderator": true,373              "trust_level": 2374            }375          }376        ]377      },378      {379        "fancy_title": "Resnet101 encoder with U-Net decoder from scratch - tensor size issue",380        "id": 212738,381        "title": "Resnet101 encoder with U-Net decoder from scratch - tensor size issue",382        "slug": "resnet101-encoder-with-u-net-decoder-from-scratch-tensor-size-issue",383        "posts_count": 1,384        "reply_count": 0,385        "highest_post_number": 1,386        "image_url": null,387        "created_at": "2024-11-09T13:32:48.917Z",388        "last_posted_at": "2024-11-09T13:32:48.977Z",389        "bumped": true,390        "bumped_at": "2024-11-09T13:32:48.977Z",391        "archetype": "regular",392        "unseen": false,393        "pinned": false,394        "unpinned": null,395        "visible": true,396        "closed": false,397        "archived": false,398        "bookmarked": null,399        "liked": null,400        "tags_descriptions": {},401        "like_count": 0,402        "views": 186,403        "category_id": 5,404        "featured_link": null,405        "has_accepted_answer": false,406        "posters": [407          {408            "extras": "latest single",409            "description": "Original Poster, Most Recent Poster",410            "user": {411              "id": 80787,412              "username": "neen4",413              "name": "",414              "avatar_template": "/letter_avatar_proxy/v4/letter/n/4af34b/{size}.png",415              "trust_level": 1416            }417          }418        ]419      },420      {421        "fancy_title": "Synthetic YOLO Dataset Generator",422        "id": 222024,423        "title": "Synthetic YOLO Dataset Generator",424        "slug": "synthetic-yolo-dataset-generator",425        "posts_count": 1,426        "reply_count": 0,427        "highest_post_number": 1,428        "image_url": null,429        "created_at": "2025-08-04T01:55:28.314Z",430        "last_posted_at": "2025-08-04T01:55:28.368Z",431        "bumped": true,432        "bumped_at": "2025-08-04T01:55:28.368Z",433        "archetype": "regular",434        "unseen": false,435        "pinned": false,436        "unpinned": null,437        "visible": true,438        "closed": false,439        "archived": false,440        "bookmarked": null,441        "liked": null,442        "tags_descriptions": {},443        "like_count": 0,444        "views": 66,445        "category_id": 5,446        "featured_link": null,447        "has_accepted_answer": false,448        "posters": [449          {450            "extras": "latest single",451            "description": "Original Poster, Most Recent Poster",452            "user": {453              "id": 85339,454              "username": "Igor1",455              "name": "Igor",456              "avatar_template": "/user_avatar/discuss.pytorch.org/igor1/{size}/77857_2.png",457              "trust_level": 0458            }459          }460        ]461      }462    ],463    "tags_descriptions": {},464    "fancy_title": "RuntimeError: shape &lsquo;[-1, 3, 480, 640]&rsquo; is invalid for input of size 307200",465    "id": 93849,466    "title": "RuntimeError: shape '[-1, 3, 480, 640]' is invalid for input of size 307200",467    "posts_count": 3,468    "created_at": "2020-08-24T03:08:04.612Z",469    "views": 2787,470    "reply_count": 0,471    "like_count": 2,472    "last_posted_at": "2020-08-24T12:11:48.066Z",473    "visible": true,474    "closed": false,475    "archived": false,476    "has_summary": false,477    "archetype": "regular",478    "slug": "runtimeerror-shape-1-3-480-640-is-invalid-for-input-of-size-307200",479    "category_id": 5,480    "word_count": 1119,481    "deleted_at": null,482    "user_id": 35867,483    "featured_link": null,484    "pinned_globally": false,485    "pinned_at": null,486    "pinned_until": null,487    "image_url": null,488    "slow_mode_seconds": 0,489    "draft": null,490    "draft_key": "topic_93849",491    "draft_sequence": null,492    "unpinned": null,493    "pinned": false,494    "current_post_number": 1,495    "highest_post_number": 3,496    "deleted_by": null,497    "actions_summary": [498      {499        "id": 4,500        "count": 0,501        "hidden": false,502        "can_act": false503      },504      {505        "id": 8,506        "count": 0,507        "hidden": false,508        "can_act": false509      },510      {511        "id": 10,512        "count": 0,513        "hidden": false,514        "can_act": false515      },516      {517        "id": 7,518        "count": 0,519        "hidden": false,520        "can_act": false521      }522    ],523    "chunk_size": 20,524    "bookmarked": false,525    "topic_timer": null,526    "message_bus_last_id": 0,527    "participant_count": 3,528    "show_read_indicator": false,529    "thumbnails": null,530    "slow_mode_enabled_until": null,531    "accepted_answer": {532      "post_number": 2,533      "username": "RaLo4",534      "name": "",535      "excerpt": "There’s a lot of weird things here, but to address the error you are getting: \nThis particular error should be gone if you change this line: \n\nTo either this: \nx = torch.randn(3, 480, 640).view(-1, 3, 480, 640) # batch, channel, height, width\n\nOr this: \nx = torch.randn(1, 3, 480, 640) # batch, chann&hellip;"536    },537    "can_vote": false,538    "vote_count": 0,539    "user_voted": false,540    "discourse_zendesk_plugin_zendesk_id": null,541    "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",542    "details": {543      "can_edit": false,544      "notification_level": 1,545      "participants": [546        {547          "id": 34381,548          "username": "Usama_Hasan",549          "name": "Usama Hasan",550          "avatar_template": "/user_avatar/discuss.pytorch.org/usama_hasan/{size}/29254_2.png",551          "post_count": 1,552          "primary_group_name": null,553          "flair_name": null,554          "flair_url": null,555          "flair_color": null,556          "flair_bg_color": null,557          "flair_group_id": null,558          "trust_level": 2559        },560        {561          "id": 34590,562          "username": "RaLo4",563          "name": "",564          "avatar_template": "/letter_avatar_proxy/v4/letter/r/65b543/{size}.png",565          "post_count": 1,566          "primary_group_name": null,567          "flair_name": null,568          "flair_url": null,569          "flair_color": null,570          "flair_bg_color": null,571          "flair_group_id": null,572          "trust_level": 2573        },574        {575          "id": 35867,576          "username": "Leo_Frez",577          "name": "Leo Frez",578          "avatar_template": "/user_avatar/discuss.pytorch.org/leo_frez/{size}/28083_2.png",579          "post_count": 1,580          "primary_group_name": null,581          "flair_name": null,582          "flair_url": null,583          "flair_color": null,584          "flair_bg_color": null,585          "flair_group_id": null,586          "trust_level": 1587        }588      ],589      "created_by": {590        "id": 35867,591        "username": "Leo_Frez",592        "name": "Leo Frez",593        "avatar_template": "/user_avatar/discuss.pytorch.org/leo_frez/{size}/28083_2.png"594      },595      "last_poster": {596        "id": 34381,597        "username": "Usama_Hasan",598        "name": "Usama Hasan",599        "avatar_template": "/user_avatar/discuss.pytorch.org/usama_hasan/{size}/29254_2.png"600      }601    },602    "bookmarks": []603  },604  {605    "post_stream": {606      "posts": [607        {608          "id": 139128,609          "name": "Marc",610          "username": "marcpf97",611          "avatar_template": "/letter_avatar_proxy/v4/letter/m/8dc957/{size}.png",612          "created_at": "2019-10-10T15:59:00.645Z",613          "cooked": "<p>Hey guys hoping anyone can help.<br>\nI am using this guys <a href=\"https://github.com/CorentinJ/Real-Time-Voice-Cloning\" rel=\"noopener nofollow ugc\">real time voice cloning</a> project to be able to make a recreation of my voice in TTS. He provides pre-trained encoder models for this and it should be as simple as inputting a recording of my voice for it to train itself.</p>\n<p>I run into a problem on run-time which is as follows (Sorry it’s a screenshot, I am not home to run this again to paste the code) :</p>\n<p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://discuss.pytorch.org/uploads/default/original/3X/5/c/5c9f9f9cc6950b8d8ca6abd0204c8314522c6eb8.jpeg\" data-download-href=\"https://discuss.pytorch.org/uploads/default/5c9f9f9cc6950b8d8ca6abd0204c8314522c6eb8\" title=\"image\"><img src=\"https://discuss.pytorch.org/uploads/default/optimized/3X/5/c/5c9f9f9cc6950b8d8ca6abd0204c8314522c6eb8_2_690x393.jpeg\" alt=\"image\" data-base62-sha1=\"ddnUYIQClfYNy4sQH508SkBvvVm\" width=\"690\" height=\"393\" srcset=\"https://discuss.pytorch.org/uploads/default/optimized/3X/5/c/5c9f9f9cc6950b8d8ca6abd0204c8314522c6eb8_2_690x393.jpeg, https://discuss.pytorch.org/uploads/default/original/3X/5/c/5c9f9f9cc6950b8d8ca6abd0204c8314522c6eb8.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/5/c/5c9f9f9cc6950b8d8ca6abd0204c8314522c6eb8.jpeg 2x\" data-dominant-color=\"0E0F10\"><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\">image</span><span class=\"informations\">1003×572 224 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></p>\n<p>Does anybody have experience with this error? I can provide more detail as needed, I am pretty inexperienced with this stuff and am not sure where to even begin debugging this.</p>\n<p>Thanks all!</p>",614          "post_number": 1,615          "post_type": 1,616          "posts_count": 6,617          "updated_at": "2019-10-10T15:59:00.645Z",618          "reply_count": 0,619          "reply_to_post_number": null,620          "quote_count": 0,621          "incoming_link_count": 2778,622          "reads": 70,623          "readers_count": 69,624          "score": 13874.0,625          "yours": false,626          "topic_id": 57893,627          "topic_slug": "missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model",628          "display_username": "Marc",629          "primary_group_name": null,630          "flair_name": null,631          "flair_url": null,632          "flair_bg_color": null,633          "flair_color": null,634          "flair_group_id": null,635          "badges_granted": [],636          "version": 1,637          "can_edit": false,638          "can_delete": false,639          "can_recover": false,640          "can_see_hidden_post": false,641          "can_wiki": false,642          "link_counts": [643            {644              "url": "https://github.com/CorentinJ/Real-Time-Voice-Cloning",645              "internal": false,646              "reflection": false,647              "title": "GitHub - CorentinJ/Real-Time-Voice-Cloning: Clone a voice in 5 seconds to generate arbitrary speech in real-time",648              "clicks": 5649            },650            {651              "url": "https://discuss.pytorch.org/uploads/default/original/3X/5/c/5c9f9f9cc6950b8d8ca6abd0204c8314522c6eb8.jpeg",652              "internal": true,653              "reflection": false,654              "clicks": 0655            }656          ],657          "read": true,658          "user_title": null,659          "bookmarked": false,660          "actions_summary": [],661          "moderator": false,662          "admin": false,663          "staff": false,664          "user_id": 23234,665          "hidden": false,666          "trust_level": 0,667          "deleted_at": null,668          "user_deleted": false,669          "edit_reason": null,670          "can_view_edit_history": true,671          "wiki": false,672          "post_url": "/t/missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model/57893/1",673          "can_accept_answer": false,674          "can_unaccept_answer": false,675          "accepted_answer": false,676          "topic_accepted_answer": null,677          "can_vote": false678        },679        {680          "id": 139129,681          "name": "",682          "username": "ptrblck",683          "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",684          "created_at": "2019-10-10T16:04:54.432Z",685          "cooked": "<p>Could you post the code, which creates this issue?<br>\nAre you sure you are loading the right <code>state_dict</code> for the model?</p>",686          "post_number": 2,687          "post_type": 1,688          "posts_count": 6,689          "updated_at": "2019-10-10T16:04:54.432Z",690          "reply_count": 1,691          "reply_to_post_number": null,692          "quote_count": 0,693          "incoming_link_count": 6,694          "reads": 72,695          "readers_count": 71,696          "score": 49.4,697          "yours": false,698          "topic_id": 57893,699          "topic_slug": "missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model",700          "display_username": "",701          "primary_group_name": null,702          "flair_name": null,703          "flair_url": null,704          "flair_bg_color": null,705          "flair_color": null,706          "flair_group_id": null,707          "badges_granted": [],708          "version": 1,709          "can_edit": false,710          "can_delete": false,711          "can_recover": false,712          "can_see_hidden_post": false,713          "can_wiki": false,714          "read": true,715          "user_title": "",716          "bookmarked": false,717          "actions_summary": [],718          "moderator": true,719          "admin": true,720          "staff": true,721          "user_id": 3534,722          "hidden": false,723          "trust_level": 2,724          "deleted_at": null,725          "user_deleted": false,726          "edit_reason": null,727          "can_view_edit_history": true,728          "wiki": false,729          "post_url": "/t/missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model/57893/2",730          "can_accept_answer": false,731          "can_unaccept_answer": false,732          "accepted_answer": false,733          "topic_accepted_answer": null734        },735        {736          "id": 139164,737          "name": "Marc",738          "username": "marcpf97",739          "avatar_template": "/letter_avatar_proxy/v4/letter/m/8dc957/{size}.png",740          "created_at": "2019-10-10T22:50:49.954Z",741          "cooked": "<p>Okay here’s the code I’m running that throws the error:</p>\n<blockquote>\n<pre><code class=\"lang-auto\">from encoder.params_model import model_embedding_size as speaker_embedding_size\nfrom utils.argutils import print_args\nfrom synthesizer.inference import Synthesizer\nfrom encoder import inference as encoder\nfrom vocoder import inference as vocoder\nfrom pathlib import Path\nimport numpy as np\nimport librosa\nimport argparse\nimport torch\nimport sys\n\n\nif __name__ == '__main__':\n    ## Info &amp; args\n    parser = argparse.ArgumentParser(\n        formatter_class=argparse.ArgumentDefaultsHelpFormatter\n    )\n    parser.add_argument(\"-e\", \"--enc_model_fpath\", type=Path, \n                        default=\"encoder/saved_models/pretrained.pt\",\n                        help=\"Path to a saved encoder\")\n    parser.add_argument(\"-s\", \"--syn_model_dir\", type=Path, \n                        default=\"synthesizer/saved_models/logs-pretrained/\",\n                        help=\"Directory containing the synthesizer model\")\n    parser.add_argument(\"-v\", \"--voc_model_fpath\", type=Path, \n                        default=\"vocoder/saved_models/pretrained/pretrained.pt\",\n                        help=\"Path to a saved vocoder\")\n    parser.add_argument(\"--low_mem\", action=\"store_true\", help=\\\n        \"If True, the memory used by the synthesizer will be freed after each use. Adds large \"\n        \"overhead but allows to save some GPU memory for lower-end GPUs.\")\n    parser.add_argument(\"--no_sound\", action=\"store_true\", help=\\\n        \"If True, audio won't be played.\")\n    args = parser.parse_args()\n    print_args(args, parser)\n    if not args.no_sound:\n        import sounddevice as sd\n        \n    \n    ## Print some environment information (for debugging purposes)\n    print(\"Running a test of your configuration...\\n\")\n    if not torch.cuda.is_available():\n        print(\"Your PyTorch installation is not configured to use CUDA. If you have a GPU ready \"\n              \"for deep learning, ensure that the drivers are properly installed, and that your \"\n              \"CUDA version matches your PyTorch installation. CPU-only inference is currently \"\n              \"not supported.\", file=sys.stderr)\n        quit(-1)\n    device_id = torch.cuda.current_device()\n    gpu_properties = torch.cuda.get_device_properties(device_id)\n    print(\"Found %d GPUs available. Using GPU %d (%s) of compute capability %d.%d with \"\n          \"%.1fGb total memory.\\n\" % \n          (torch.cuda.device_count(),\n           device_id,\n           gpu_properties.name,\n           gpu_properties.major,\n           gpu_properties.minor,\n           gpu_properties.total_memory / 1e9))\n    \n    \n    ## Load the models one by one.\n    print(\"Preparing the encoder, the synthesizer and the vocoder...\")\n    encoder.load_model(args.enc_model_fpath)\n    synthesizer = Synthesizer(args.syn_model_dir.joinpath(\"taco_pretrained\"), low_mem=args.low_mem)\n    vocoder.load_model(args.voc_model_fpath)\n    \n    \n    ## Run a test\n    print(\"Testing your configuration with small inputs.\")\n    # Forward an audio waveform of zeroes that lasts 1 second. Notice how we can get the encoder's\n    # sampling rate, which may differ.\n    # If you're unfamiliar with digital audio, know that it is encoded as an array of floats \n    # (or sometimes integers, but mostly floats in this projects) ranging from -1 to 1.\n    # The sampling rate is the number of values (samples) recorded per second, it is set to\n    # 16000 for the encoder. Creating an array of length &lt;sampling_rate&gt; will always correspond \n    # to an audio of 1 second.\n    print(\"\\tTesting the encoder...\")\n    encoder.embed_utterance(np.zeros(encoder.sampling_rate))\n    \n    # Create a dummy embedding. You would normally use the embedding that encoder.embed_utterance\n    # returns, but here we're going to make one ourselves just for the sake of showing that it's\n    # possible.\n    embed = np.random.rand(speaker_embedding_size)\n    # Embeddings are L2-normalized (this isn't important here, but if you want to make your own \n    # embeddings it will be).\n    embed /= np.linalg.norm(embed)\n    # The synthesizer can handle multiple inputs with batching. Let's create another embedding to \n    # illustrate that\n    embeds = [embed, np.zeros(speaker_embedding_size)]\n    texts = [\"test 1\", \"test 2\"]\n    print(\"\\tTesting the synthesizer... (loading the model will output a lot of text)\")\n    mels = synthesizer.synthesize_spectrograms(texts, embeds)\n    \n    # The vocoder synthesizes one waveform at a time, but it's more efficient for long ones. We \n    # can concatenate the mel spectrograms to a single one.\n    mel = np.concatenate(mels, axis=1)\n    # The vocoder can take a callback function to display the generation. More on that later. For \n    # now we'll simply hide it like this:\n    no_action = lambda *args: None\n    print(\"\\tTesting the vocoder...\")\n    # For the sake of making this test short, we'll pass a short target length. The target length \n    # is the length of the wav segments that are processed in parallel. E.g. for audio sampled \n    # at 16000 Hertz, a target length of 8000 means that the target audio will be cut in chunks of\n    # 0.5 seconds which will all be generated together. The parameters here are absurdly short, and \n    # that has a detrimental effect on the quality of the audio. The default parameters are \n    # recommended in general.\n    vocoder.infer_waveform(mel, target=200, overlap=50, progress_callback=no_action)\n    \n    print(\"All test passed! You can now synthesize speech.\\n\\n\")\n    \n    \n    ## Interactive speech generation\n    print(\"This is a GUI-less example of interface to SV2TTS. The purpose of this script is to \"\n          \"show how you can interface this project easily with your own. See the source code for \"\n          \"an explanation of what is happening.\\n\")\n    \n    print(\"Interactive generation loop\")\n    num_generated = 0\n    while True:\n        try:\n            # Get the reference audio filepath\n            message = \"Reference voice: enter an audio filepath of a voice to be cloned (mp3, \" \\\n                      \"wav, m4a, flac, ...):\\n\"\n            in_fpath = Path(input(message).replace(\"\\\"\", \"\").replace(\"\\'\", \"\"))\n            \n            \n            ## Computing the embedding\n            # First, we load the wav using the function that the speaker encoder provides. This is \n            # important: there is preprocessing that must be applied.\n            \n            # The following two methods are equivalent:\n            # - Directly load from the filepath:\n            preprocessed_wav = encoder.preprocess_wav(in_fpath)\n            # - If the wav is already loaded:\n            original_wav, sampling_rate = librosa.load(in_fpath)\n            preprocessed_wav = encoder.preprocess_wav(original_wav, sampling_rate)\n            print(\"Loaded file succesfully\")\n            \n            # Then we derive the embedding. There are many functions and parameters that the \n            # speaker encoder interfaces. These are mostly for in-depth research. You will typically\n            # only use this function (with its default parameters):\n            embed = encoder.embed_utterance(preprocessed_wav)\n            print(\"Created the embedding\")\n            \n            \n            ## Generating the spectrogram\n            text = input(\"Write a sentence (+-20 words) to be synthesized:\\n\")\n            \n            # The synthesizer works in batch, so you need to put your data in a list or numpy array\n            texts = [text]\n            embeds = [embed]\n            # If you know what the attention layer alignments are, you can retrieve them here by\n            # passing return_alignments=True\n            specs = synthesizer.synthesize_spectrograms(texts, embeds)\n            spec = specs[0]\n            print(\"Created the mel spectrogram\")\n            \n            \n            ## Generating the waveform\n            print(\"Synthesizing the waveform:\")\n            # Synthesizing the waveform is fairly straightforward. Remember that the longer the\n            # spectrogram, the more time-efficient the vocoder.\n            generated_wav = vocoder.infer_waveform(spec)\n            \n            \n            ## Post-generation\n            # There's a bug with sounddevice that makes the audio cut one second earlier, so we\n            # pad it.\n            generated_wav = np.pad(generated_wav, (0, synthesizer.sample_rate), mode=\"constant\")\n            \n            # Play the audio (non-blocking)\n            if not args.no_sound:\n                sd.stop()\n                sd.play(generated_wav, synthesizer.sample_rate)\n                \n            # Save it on the disk\n            fpath = \"demo_output_%02d.wav\" % num_generated\n            print(generated_wav.dtype)\n            librosa.output.write_wav(fpath, generated_wav.astype(np.float32), \n                                     synthesizer.sample_rate)\n            num_generated += 1\n            print(\"\\nSaved output as %s\\n\\n\" % fpath)\n            \n            \n        except Exception as e:\n            print(\"Caught exception: %s\" % repr(e))\n            print(\"Restarting\\n\")\n</code></pre>\n</blockquote>\n<p>Along with:</p>\n<pre><code class=\"lang-auto\">Blockquote\nfrom encoder.params_data import *\nfrom encoder.model import SpeakerEncoder\nfrom encoder.audio import preprocess_wav   # We want to expose this function from here\nfrom matplotlib import cm\nfrom encoder import audio\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\n\n_model = None # type: SpeakerEncoder\n_device = None # type: torch.device\n\n\ndef load_model(weights_fpath: Path, device=None):\n    \"\"\"\n    Loads the model in memory. If this function is not explicitely called, it will be run on the \n    first call to embed_frames() with the default weights file.\n    \n    :param weights_fpath: the path to saved model weights.\n    :param device: either a torch device or the name of a torch device (e.g. \"cpu\", \"cuda\"). The \n    model will be loaded and will run on this device. Outputs will however always be on the cpu. \n    If None, will default to your GPU if it\"s available, otherwise your CPU.\n    \"\"\"\n    # TODO: I think the slow loading of the encoder might have something to do with the device it\n    #   was saved on. Worth investigating.\n    global _model, _device\n    if device is None:\n        _device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n    elif isinstance(device, str):\n        _device = torch.device(device)\n    _model = SpeakerEncoder(_device, torch.device(\"cpu\"))\n    checkpoint = torch.load(weights_fpath)\n    _model.load_state_dict(checkpoint[\"model_state\"])\n    _model.eval()\n    print(\"Loaded encoder \\\"%s\\\" trained to step %d\" % (weights_fpath.name, checkpoint[\"step\"]))\n    \n    \ndef is_loaded():\n    return _model is not None\n\n\ndef embed_frames_batch(frames_batch):\n    \"\"\"\n    Computes embeddings for a batch of mel spectrogram.\n    \n    :param frames_batch: a batch mel of spectrogram as a numpy array of float32 of shape \n    (batch_size, n_frames, n_channels)\n    :return: the embeddings as a numpy array of float32 of shape (batch_size, model_embedding_size)\n    \"\"\"\n    if _model is None:\n        raise Exception(\"Model was not loaded. Call load_model() before inference.\")\n    \n    frames = torch.from_numpy(frames_batch).to(_device)\n    embed = _model.forward(frames).detach().cpu().numpy()\n    return embed\n\n\ndef compute_partial_slices(n_samples, partial_utterance_n_frames=partials_n_frames,\n                           min_pad_coverage=0.75, overlap=0.5):\n    \"\"\"\n    Computes where to split an utterance waveform and its corresponding mel spectrogram to obtain \n    partial utterances of &lt;partial_utterance_n_frames&gt; each. Both the waveform and the mel \n    spectrogram slices are returned, so as to make each partial utterance waveform correspond to \n    its spectrogram. This function assumes that the mel spectrogram parameters used are those \n    defined in params_data.py.\n    \n    The returned ranges may be indexing further than the length of the waveform. It is \n    recommended that you pad the waveform with zeros up to wave_slices[-1].stop.\n    \n    :param n_samples: the number of samples in the waveform\n    :param partial_utterance_n_frames: the number of mel spectrogram frames in each partial \n    utterance\n    :param min_pad_coverage: when reaching the last partial utterance, it may or may not have \n    enough frames. If at least &lt;min_pad_coverage&gt; of &lt;partial_utterance_n_frames&gt; are present, \n    then the last partial utterance will be considered, as if we padded the audio. Otherwise, \n    it will be discarded, as if we trimmed the audio. If there aren't enough frames for 1 partial \n    utterance, this parameter is ignored so that the function always returns at least 1 slice.\n    :param overlap: by how much the partial utterance should overlap. If set to 0, the partial \n    utterances are entirely disjoint. \n    :return: the waveform slices and mel spectrogram slices as lists of array slices. Index \n    respectively the waveform and the mel spectrogram with these slices to obtain the partial \n    utterances.\n    \"\"\"\n    assert 0 &lt;= overlap &lt; 1\n    assert 0 &lt; min_pad_coverage &lt;= 1\n    \n    samples_per_frame = int((sampling_rate * mel_window_step / 1000))\n    n_frames = int(np.ceil((n_samples + 1) / samples_per_frame))\n    frame_step = max(int(np.round(partial_utterance_n_frames * (1 - overlap))), 1)\n\n    # Compute the slices\n    wav_slices, mel_slices = [], []\n    steps = max(1, n_frames - partial_utterance_n_frames + frame_step + 1)\n    for i in range(0, steps, frame_step):\n        mel_range = np.array([i, i + partial_utterance_n_frames])\n        wav_range = mel_range * samples_per_frame\n        mel_slices.append(slice(*mel_range))\n        wav_slices.append(slice(*wav_range))\n        \n    # Evaluate whether extra padding is warranted or not\n    last_wav_range = wav_slices[-1]\n    coverage = (n_samples - last_wav_range.start) / (last_wav_range.stop - last_wav_range.start)\n    if coverage &lt; min_pad_coverage and len(mel_slices) &gt; 1:\n        mel_slices = mel_slices[:-1]\n        wav_slices = wav_slices[:-1]\n    \n    return wav_slices, mel_slices\n\n\ndef embed_utterance(wav, using_partials=True, return_partials=False, **kwargs):\n    \"\"\"\n    Computes an embedding for a single utterance.\n    \n    # TODO: handle multiple wavs to benefit from batching on GPU\n    :param wav: a preprocessed (see audio.py) utterance waveform as a numpy array of float32\n    :param using_partials: if True, then the utterance is split in partial utterances of \n    &lt;partial_utterance_n_frames&gt; frames and the utterance embedding is computed from their \n    normalized average. If False, the utterance is instead computed from feeding the entire \n    spectogram to the network.\n    :param return_partials: if True, the partial embeddings will also be returned along with the \n    wav slices that correspond to the partial embeddings.\n    :param kwargs: additional arguments to compute_partial_splits()\n    :return: the embedding as a numpy array of float32 of shape (model_embedding_size,). If \n    &lt;return_partials&gt; is True, the partial utterances as a numpy array of float32 of shape \n    (n_partials, model_embedding_size) and the wav partials as a list of slices will also be \n    returned. If &lt;using_partials&gt; is simultaneously set to False, both these values will be None \n    instead.\n    \"\"\"\n    # Process the entire utterance if not using partials\n    if not using_partials:\n        frames = audio.wav_to_mel_spectrogram(wav)\n        embed = embed_frames_batch(frames[None, ...])[0]\n        if return_partials:\n            return embed, None, None\n        return embed\n    \n    # Compute where to split the utterance into partials and pad if necessary\n    wave_slices, mel_slices = compute_partial_slices(len(wav), **kwargs)\n    max_wave_length = wave_slices[-1].stop\n    if max_wave_length &gt;= len(wav):\n        wav = np.pad(wav, (0, max_wave_length - len(wav)), \"constant\")\n    \n    # Split the utterance into partials\n    frames = audio.wav_to_mel_spectrogram(wav)\n    frames_batch = np.array([frames[s] for s in mel_slices])\n    partial_embeds = embed_frames_batch(frames_batch)\n    \n    # Compute the utterance embedding from the partial embeddings\n    raw_embed = np.mean(partial_embeds, axis=0)\n    embed = raw_embed / np.linalg.norm(raw_embed, 2)\n    \n    if return_partials:\n        return embed, partial_embeds, wave_slices\n    return embed\n\n\ndef embed_speaker(wavs, **kwargs):\n    raise NotImplemented()\n\n\ndef plot_embedding_as_heatmap(embed, ax=None, title=\"\", shape=None, color_range=(0, 0.30)):\n    if ax is None:\n        ax = plt.gca()\n    \n    if shape is None:\n        height = int(np.sqrt(len(embed)))\n        shape = (height, -1)\n    embed = embed.reshape(shape)\n    \n    cmap = cm.get_cmap()\n    mappable = ax.imshow(embed, cmap=cmap)\n    cbar = plt.colorbar(mappable, ax=ax, fraction=0.046, pad=0.04)\n    cbar.set_clim(*color_range)\n    \n    ax.set_xticks([]), ax.set_yticks([])\n    ax.set_title(title)\n</code></pre>",742          "post_number": 3,743          "post_type": 1,744          "posts_count": 6,745          "updated_at": "2019-10-10T22:53:28.125Z",746          "reply_count": 1,747          "reply_to_post_number": 2,748          "quote_count": 0,749          "incoming_link_count": 29,750          "reads": 70,751          "readers_count": 69,752          "score": 164.0,753          "yours": false,754          "topic_id": 57893,755          "topic_slug": "missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model",756          "display_username": "Marc",757          "primary_group_name": null,758          "flair_name": null,759          "flair_url": null,760          "flair_bg_color": null,761          "flair_color": null,762          "flair_group_id": null,763          "badges_granted": [],764          "version": 2,765          "can_edit": false,766          "can_delete": false,767          "can_recover": false,768          "can_see_hidden_post": false,769          "can_wiki": false,770          "read": true,771          "user_title": null,772          "reply_to_user": {773            "id": 3534,774            "username": "ptrblck",775            "name": "",776            "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"777          },778          "bookmarked": false,779          "actions_summary": [],780          "moderator": false,781          "admin": false,782          "staff": false,783          "user_id": 23234,784          "hidden": false,785          "trust_level": 0,786          "deleted_at": null,787          "user_deleted": false,788          "edit_reason": null,789          "can_view_edit_history": true,790          "wiki": false,791          "post_url": "/t/missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model/57893/3",792          "can_accept_answer": false,793          "can_unaccept_answer": false,794          "accepted_answer": false,795          "topic_accepted_answer": null796        },797        {798          "id": 139165,799          "name": "Marc",800          "username": "marcpf97",801          "avatar_template": "/letter_avatar_proxy/v4/letter/m/8dc957/{size}.png",802          "created_at": "2019-10-10T22:54:01.896Z",803          "cooked": "<p>And the full error is:</p>\n<pre><code class=\"lang-auto\">Preparing the encoder, the synthesizer and the vocoder...\nTraceback (most recent call last):\n  File \"demo_cli.py\", line 61, in &lt;module&gt;\n    encoder.load_model(args.enc_model_fpath)\n  File \"C:\\Users\\Marc\\Desktop\\Real-Time-Voice-Cloning-master\\Real-Time-Voice-Cloning-master\\encoder\\inference.py\", line 34, in load_model\n    _model.load_state_dict(checkpoint[\"model_state\"])\n  File \"C:\\Users\\Marc\\Anaconda3\\lib\\site-packages\\torch\\nn\\modules\\module.py\", line 845, in load_state_dict\n    self.__class__.__name__, \"\\n\\t\".join(error_msgs)))\nRuntimeError: Error(s) in loading state_dict for SpeakerEncoder:\n        Missing key(s) in state_dict: \"similarity_weight\", \"similarity_bias\", \"lstm.weight_ih_l0\", \"lstm.weight_hh_l0\", \"lstm.bias_ih_l0\", \"lstm.bias_hh_l0\", \"lstm.weight_ih_l1\", \"lstm.weight_hh_l1\", \"lstm.bias_ih_l1\", \"lstm.bias_hh_l1\", \"lstm.weight_ih_l2\", \"lstm.weight_hh_l2\", \"lstm.bias_ih_l2\", \"lstm.bias_hh_l2\", \"linear.weight\", \"linear.bias\".\n        Unexpected key(s) in state_dict: \"step\", \"upsample.resnet.conv_in.weight\", \"upsample.resnet.batch_norm.weight\", \"upsample.resnet.batch_norm.bias\", \"upsample.resnet.batch_norm.running_mean\", \"upsample.resnet.batch_norm.running_var\", \"upsample.resnet.batch_norm.num_batches_tracked\", \"upsample.resnet.layers.0.conv1.weight\", \"upsample.resnet.layers.0.conv2.weight\", \"upsample.resnet.layers.0.batch_norm1.weight\", \"upsample.resnet.layers.0.batch_norm1.bias\", \"upsample.resnet.layers.0.batch_norm1.running_mean\", \"upsample.resnet.layers.0.batch_norm1.running_var\", \"upsample.resnet.layers.0.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.0.batch_norm2.weight\", \"upsample.resnet.layers.0.batch_norm2.bias\", \"upsample.resnet.layers.0.batch_norm2.running_mean\", \"upsample.resnet.layers.0.batch_norm2.running_var\", \"upsample.resnet.layers.0.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.1.conv1.weight\", \"upsample.resnet.layers.1.conv2.weight\", \"upsample.resnet.layers.1.batch_norm1.weight\", \"upsample.resnet.layers.1.batch_norm1.bias\", \"upsample.resnet.layers.1.batch_norm1.running_mean\", \"upsample.resnet.layers.1.batch_norm1.running_var\", \"upsample.resnet.layers.1.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.1.batch_norm2.weight\", \"upsample.resnet.layers.1.batch_norm2.bias\", \"upsample.resnet.layers.1.batch_norm2.running_mean\", \"upsample.resnet.layers.1.batch_norm2.running_var\", \"upsample.resnet.layers.1.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.2.conv1.weight\", \"upsample.resnet.layers.2.conv2.weight\", \"upsample.resnet.layers.2.batch_norm1.weight\", \"upsample.resnet.layers.2.batch_norm1.bias\", \"upsample.resnet.layers.2.batch_norm1.running_mean\", \"upsample.resnet.layers.2.batch_norm1.running_var\", \"upsample.resnet.layers.2.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.2.batch_norm2.weight\", \"upsample.resnet.layers.2.batch_norm2.bias\", \"upsample.resnet.layers.2.batch_norm2.running_mean\", \"upsample.resnet.layers.2.batch_norm2.running_var\", \"upsample.resnet.layers.2.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.3.conv1.weight\", \"upsample.resnet.layers.3.conv2.weight\", \"upsample.resnet.layers.3.batch_norm1.weight\", \"upsample.resnet.layers.3.batch_norm1.bias\", \"upsample.resnet.layers.3.batch_norm1.running_mean\", \"upsample.resnet.layers.3.batch_norm1.running_var\", \"upsample.resnet.layers.3.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.3.batch_norm2.weight\", \"upsample.resnet.layers.3.batch_norm2.bias\", \"upsample.resnet.layers.3.batch_norm2.running_mean\", \"upsample.resnet.layers.3.batch_norm2.running_var\", \"upsample.resnet.layers.3.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.4.conv1.weight\", \"upsample.resnet.layers.4.conv2.weight\", \"upsample.resnet.layers.4.batch_norm1.weight\", \"upsample.resnet.layers.4.batch_norm1.bias\", \"upsample.resnet.layers.4.batch_norm1.running_mean\", \"upsample.resnet.layers.4.batch_norm1.running_var\", \"upsample.resnet.layers.4.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.4.batch_norm2.weight\", \"upsample.resnet.layers.4.batch_norm2.bias\", \"upsample.resnet.layers.4.batch_norm2.running_mean\", \"upsample.resnet.layers.4.batch_norm2.running_var\", \"upsample.resnet.layers.4.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.5.conv1.weight\", \"upsample.resnet.layers.5.conv2.weight\", \"upsample.resnet.layers.5.batch_norm1.weight\", \"upsample.resnet.layers.5.batch_norm1.bias\", \"upsample.resnet.layers.5.batch_norm1.running_mean\", \"upsample.resnet.layers.5.batch_norm1.running_var\", \"upsample.resnet.layers.5.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.5.batch_norm2.weight\", \"upsample.resnet.layers.5.batch_norm2.bias\", \"upsample.resnet.layers.5.batch_norm2.running_mean\", \"upsample.resnet.layers.5.batch_norm2.running_var\", \"upsample.resnet.layers.5.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.6.conv1.weight\", \"upsample.resnet.layers.6.conv2.weight\", \"upsample.resnet.layers.6.batch_norm1.weight\", \"upsample.resnet.layers.6.batch_norm1.bias\", \"upsample.resnet.layers.6.batch_norm1.running_mean\", \"upsample.resnet.layers.6.batch_norm1.running_var\", \"upsample.resnet.layers.6.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.6.batch_norm2.weight\", \"upsample.resnet.layers.6.batch_norm2.bias\", \"upsample.resnet.layers.6.batch_norm2.running_mean\", \"upsample.resnet.layers.6.batch_norm2.running_var\", \"upsample.resnet.layers.6.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.7.conv1.weight\", \"upsample.resnet.layers.7.conv2.weight\", \"upsample.resnet.layers.7.batch_norm1.weight\", \"upsample.resnet.layers.7.batch_norm1.bias\", \"upsample.resnet.layers.7.batch_norm1.running_mean\", \"upsample.resnet.layers.7.batch_norm1.running_var\", \"upsample.resnet.layers.7.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.7.batch_norm2.weight\", \"upsample.resnet.layers.7.batch_norm2.bias\", \"upsample.resnet.layers.7.batch_norm2.running_mean\", \"upsample.resnet.layers.7.batch_norm2.running_var\", \"upsample.resnet.layers.7.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.8.conv1.weight\", \"upsample.resnet.layers.8.conv2.weight\", \"upsample.resnet.layers.8.batch_norm1.weight\", \"upsample.resnet.layers.8.batch_norm1.bias\", \"upsample.resnet.layers.8.batch_norm1.running_mean\", \"upsample.resnet.layers.8.batch_norm1.running_var\", \"upsample.resnet.layers.8.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.8.batch_norm2.weight\", \"upsample.resnet.layers.8.batch_norm2.bias\", \"upsample.resnet.layers.8.batch_norm2.running_mean\", \"upsample.resnet.layers.8.batch_norm2.running_var\", \"upsample.resnet.layers.8.batch_norm2.num_batches_tracked\", \"upsample.resnet.layers.9.conv1.weight\", \"upsample.resnet.layers.9.conv2.weight\", \"upsample.resnet.layers.9.batch_norm1.weight\", \"upsample.resnet.layers.9.batch_norm1.bias\", \"upsample.resnet.layers.9.batch_norm1.running_mean\", \"upsample.resnet.layers.9.batch_norm1.running_var\", \"upsample.resnet.layers.9.batch_norm1.num_batches_tracked\", \"upsample.resnet.layers.9.batch_norm2.weight\", \"upsample.resnet.layers.9.batch_norm2.bias\", \"upsample.resnet.layers.9.batch_norm2.running_mean\", \"upsample.resnet.layers.9.batch_norm2.running_var\", \"upsample.resnet.layers.9.batch_norm2.num_batches_tracked\", \"upsample.resnet.conv_out.weight\", \"upsample.resnet.conv_out.bias\", \"upsample.up_layers.1.weight\", \"upsample.up_layers.3.weight\", \"upsample.up_layers.5.weight\", \"I.weight\", \"I.bias\", \"rnn1.weight_ih_l0\", \"rnn1.weight_hh_l0\", \"rnn1.bias_ih_l0\", \"rnn1.bias_hh_l0\", \"rnn2.weight_ih_l0\", \"rnn2.weight_hh_l0\", \"rnn2.bias_ih_l0\", \"rnn2.bias_hh_l0\", \"fc1.weight\", \"fc1.bias\", \"fc2.weight\", \"fc2.bias\", \"fc3.weight\", \"fc3.bias\".\nTerminateHostApis in\nTerminateHostApis out\n</code></pre>\n<blockquote>\n<p>Blockquote</p>\n</blockquote>",804          "post_number": 4,805          "post_type": 1,806          "posts_count": 6,807          "updated_at": "2019-10-10T22:54:01.896Z",808          "reply_count": 1,809          "reply_to_post_number": 3,810          "quote_count": 0,811          "incoming_link_count": 60,812          "reads": 63,813          "readers_count": 62,814          "score": 317.6,815          "yours": false,816          "topic_id": 57893,817          "topic_slug": "missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model",818          "display_username": "Marc",819          "primary_group_name": null,820          "flair_name": null,821          "flair_url": null,822          "flair_bg_color": null,823          "flair_color": null,824          "flair_group_id": null,825          "badges_granted": [],826          "version": 1,827          "can_edit": false,828          "can_delete": false,829          "can_recover": false,830          "can_see_hidden_post": false,831          "can_wiki": false,832          "read": true,833          "user_title": null,834          "reply_to_user": {835            "id": 23234,836            "username": "marcpf97",837            "name": "Marc",838            "avatar_template": "/letter_avatar_proxy/v4/letter/m/8dc957/{size}.png"839          },840          "bookmarked": false,841          "actions_summary": [],842          "moderator": false,843          "admin": false,844          "staff": false,845          "user_id": 23234,846          "hidden": false,847          "trust_level": 0,848          "deleted_at": null,849          "user_deleted": false,850          "edit_reason": null,851          "can_view_edit_history": true,852          "wiki": false,853          "post_url": "/t/missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model/57893/4",854          "can_accept_answer": false,855          "can_unaccept_answer": false,856          "accepted_answer": false,857          "topic_accepted_answer": null858        },859        {860          "id": 139463,861          "name": "",862          "username": "ptrblck",863          "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",864          "created_at": "2019-10-12T19:05:06.535Z",865          "cooked": "<p>It looks like you would like to load a <code>state_dict</code> from <a href=\"https://github.com/CorentinJ/Real-Time-Voice-Cloning/blob/d8299ecfad651f60d5f633ddb9452ba60643c247/vocoder/models/fatchord_version.py#L88\" rel=\"nofollow noopener\">WaveRNN</a> to an instance of <a href=\"https://github.com/CorentinJ/Real-Time-Voice-Cloning/blob/d8299ecfad651f60d5f633ddb9452ba60643c247/encoder/model.py#L12\" rel=\"nofollow noopener\">SpeakerEncoder</a>.</p>\n<p>Make sure to pass the right checkpoint to the corresponding model.</p>",866          "post_number": 5,867          "post_type": 1,868          "posts_count": 6,869          "updated_at": "2019-10-12T19:05:06.535Z",870          "reply_count": 0,871          "reply_to_post_number": 4,872          "quote_count": 0,873          "incoming_link_count": 26,874          "reads": 58,875          "readers_count": 57,876          "score": 141.6,877          "yours": false,878          "topic_id": 57893,879          "topic_slug": "missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model",880          "display_username": "",881          "primary_group_name": null,882          "flair_name": null,883          "flair_url": null,884          "flair_bg_color": null,885          "flair_color": null,886          "flair_group_id": null,887          "badges_granted": [],888          "version": 1,889          "can_edit": false,890          "can_delete": false,891          "can_recover": false,892          "can_see_hidden_post": false,893          "can_wiki": false,894          "link_counts": [895            {896              "url": "https://github.com/CorentinJ/Real-Time-Voice-Cloning/blob/d8299ecfad651f60d5f633ddb9452ba60643c247/vocoder/models/fatchord_version.py#L88",897              "internal": false,898              "reflection": false,899              "title": "Real-Time-Voice-Cloning/fatchord_version.py at d8299ecfad651f60d5f633ddb9452ba60643c247 · CorentinJ/Real-Time-Voice-Cloning · GitHub",900              "clicks": 14901            },902            {903              "url": "https://github.com/CorentinJ/Real-Time-Voice-Cloning/blob/d8299ecfad651f60d5f633ddb9452ba60643c247/encoder/model.py#L12",904              "internal": false,905              "reflection": false,906              "title": "Real-Time-Voice-Cloning/model.py at d8299ecfad651f60d5f633ddb9452ba60643c247 · CorentinJ/Real-Time-Voice-Cloning · GitHub",907              "clicks": 9908            }909          ],910          "read": true,911          "user_title": "",912          "reply_to_user": {913            "id": 23234,914            "username": "marcpf97",915            "name": "Marc",916            "avatar_template": "/letter_avatar_proxy/v4/letter/m/8dc957/{size}.png"917          },918          "bookmarked": false,919          "actions_summary": [],920          "moderator": true,921          "admin": true,922          "staff": true,923          "user_id": 3534,924          "hidden": false,925          "trust_level": 2,926          "deleted_at": null,927          "user_deleted": false,928          "edit_reason": null,929          "can_view_edit_history": true,930          "wiki": false,931          "post_url": "/t/missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model/57893/5",932          "can_accept_answer": false,933          "can_unaccept_answer": false,934          "accepted_answer": false,935          "topic_accepted_answer": null936        },937        {938          "id": 223532,939          "name": "Faris Hijazi",940          "username": "FarisHijazi",941          "avatar_template": "/user_avatar/discuss.pytorch.org/farishijazi/{size}/39832_2.png",942          "created_at": "2020-08-24T12:11:08.498Z",943          "cooked": "<p>While we’re on this topic, I had issues with the encoder model. I was getting the following error when trying to load the correct model:</p>\n<pre><code class=\"lang-auto\">RuntimeError: Error(s) in loading state_dict for SpeakerEncoder:\n\tUnexpected key(s) in state_dict: \"similarity_weight\", \"similarity_bias\". \n</code></pre>\n<p>At the end, it turns out I was using another pytorch version</p>\n<p><code>torch==1.5.1</code> doesn’t work<br>\n<code>torch==1.5.0</code> does work</p>",944          "post_number": 6,945          "post_type": 1,946          "posts_count": 6,947          "updated_at": "2020-08-24T12:11:24.619Z",948          "reply_count": 0,949          "reply_to_post_number": null,950          "quote_count": 0,951          "incoming_link_count": 34,952          "reads": 39,953          "readers_count": 38,954          "score": 177.8,955          "yours": false,956          "topic_id": 57893,957          "topic_slug": "missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model",958          "display_username": "Faris Hijazi",959          "primary_group_name": null,960          "flair_name": null,961          "flair_url": null,962          "flair_bg_color": null,963          "flair_color": null,964          "flair_group_id": null,965          "badges_granted": [],966          "version": 1,967          "can_edit": false,968          "can_delete": false,969          "can_recover": false,970          "can_see_hidden_post": false,971          "can_wiki": false,972          "read": true,973          "user_title": "",974          "bookmarked": false,975          "actions_summary": [],976          "moderator": false,977          "admin": false,978          "staff": false,979          "user_id": 35893,980          "hidden": false,981          "trust_level": 1,982          "deleted_at": null,983          "user_deleted": false,984          "edit_reason": null,985          "can_view_edit_history": true,986          "wiki": false,987          "post_url": "/t/missing-keys-unexpected-keys-in-state-dict-when-loading-pretrained-model/57893/6",988          "can_accept_answer": false,989          "can_unaccept_answer": false,990          "accepted_answer": false,991          "topic_accepted_answer": null992        }993      ],994      "stream": [995        139128,996        139129,997        139164,998        139165,999        139463,1000        2235321001      ]1002    },1003    "timeline_lookup": [1004      [1005        1,1006        22071007      ],1008      [1009        5,1010        22051011      ],1012      [1013        6,1014        18881015      ]1016    ],1017    "suggested_topics": [1018      {1019        "fancy_title": "Targeted Image Augmentation",1020        "id": 215621,1021        "title": "Targeted Image Augmentation",1022        "slug": "targeted-image-augmentation",1023        "posts_count": 3,1024        "reply_count": 1,1025        "highest_post_number": 3,1026        "image_url": null,1027        "created_at": "2025-01-20T12:20:38.861Z",1028        "last_posted_at": "2025-01-21T08:44:57.139Z",1029        "bumped": true,1030        "bumped_at": "2025-01-21T08:44:57.139Z",1031        "archetype": "regular",1032        "unseen": false,1033        "pinned": false,1034        "unpinned": null,1035        "visible": true,1036        "closed": false,1037        "archived": false,1038        "bookmarked": null,1039        "liked": null,1040        "tags_descriptions": {},1041        "like_count": 1,1042        "views": 191,1043        "category_id": 5,1044        "featured_link": null,1045        "has_accepted_answer": false,1046        "posters": [1047          {1048            "extras": "latest",1049            "description": "Original Poster, Most Recent Poster",1050            "user": {1051              "id": 81941,1052              "username": "MUSTAFA_CAGRI_CIVICI",1053              "name": "MUSTAFA ÇAĞRI ÇİVİCİ",1054              "avatar_template": "/user_avatar/discuss.pytorch.org/mustafa_cagri_civici/{size}/74964_2.png",1055              "trust_level": 11056            }1057          },1058          {1059            "extras": null,1060            "description": "Frequent Poster",1061            "user": {1062              "id": 18088,1063              "username": "KFrank",1064              "name": "K. Frank",1065              "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",1066              "trust_level": 21067            }1068          }1069        ]1070      },1071      {1072        "fancy_title": "Image classification with PyTorch",1073        "id": 213930,1074        "title": "Image classification with PyTorch",1075        "slug": "image-classification-with-pytorch",1076        "posts_count": 3,1077        "reply_count": 0,1078        "highest_post_number": 3,1079        "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/1/3/1381695a6060aefe405ffb28aebaae5a42069aa6_2_1024x635.jpeg",1080        "created_at": "2024-12-06T22:46:10.375Z",1081        "last_posted_at": "2024-12-09T16:57:34.885Z",1082        "bumped": true,1083        "bumped_at": "2024-12-09T16:57:34.885Z",1084        "archetype": "regular",1085        "unseen": false,1086        "pinned": false,1087        "unpinned": null,1088        "visible": true,1089        "closed": false,1090        "archived": false,1091        "bookmarked": null,1092        "liked": null,1093        "tags_descriptions": {},1094        "like_count": 0,1095        "views": 291,1096        "category_id": 5,1097        "featured_link": null,1098        "has_accepted_answer": false,1099        "posters": [1100          {1101            "extras": null,1102            "description": "Original Poster",1103            "user": {1104              "id": 81369,1105              "username": "Arek",1106              "name": "Arek",1107              "avatar_template": "/letter_avatar_proxy/v4/letter/a/46a35a/{size}.png",1108              "trust_level": 01109            }1110          },1111          {1112            "extras": null,1113            "description": "Frequent Poster",1114            "user": {1115              "id": 3534,1116              "username": "ptrblck",1117              "name": "",1118              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1119              "admin": true,1120              "moderator": true,1121              "trust_level": 21122            }1123          },1124          {1125            "extras": "latest",1126            "description": "Most Recent Poster",1127            "user": {1128              "id": 64498,1129              "username": "nickums",1130              "name": "Nickums",1131              "avatar_template": "/user_avatar/discuss.pytorch.org/nickums/{size}/58652_2.png",1132              "trust_level": 11133            }1134          }1135        ]1136      },1137      {1138        "fancy_title": "Updating masks in the Pruning",1139        "id": 214960,1140        "title": "Updating masks in the Pruning",1141        "slug": "updating-masks-in-the-pruning",1142        "posts_count": 2,1143        "reply_count": 0,1144        "highest_post_number": 2,1145        "image_url": null,1146        "created_at": "2025-01-04T13:02:22.036Z",1147        "last_posted_at": "2025-01-04T13:03:01.428Z",1148        "bumped": true,1149        "bumped_at": "2025-01-04T13:03:01.428Z",1150        "archetype": "regular",1151        "unseen": false,1152        "pinned": false,1153        "unpinned": null,1154        "visible": true,1155        "closed": false,1156        "archived": false,1157        "bookmarked": null,1158        "liked": null,1159        "tags_descriptions": {},1160        "like_count": 0,1161        "views": 36,1162        "category_id": 5,1163        "featured_link": null,1164        "has_accepted_answer": false,1165        "posters": [1166          {1167            "extras": "latest single",1168            "description": "Original Poster, Most Recent Poster",1169            "user": {1170              "id": 66508,1171              "username": "Shashank_Priyadarshi",1172              "name": "Shashank Priyadarshi",1173              "avatar_template": "/user_avatar/discuss.pytorch.org/shashank_priyadarshi/{size}/60807_2.png",1174              "trust_level": 11175            }1176          }1177        ]1178      },1179      {1180        "fancy_title": "CNN Model is not learning after some epochs",1181        "id": 215485,1182        "title": "CNN Model is not learning after some epochs",1183        "slug": "cnn-model-is-not-learning-after-some-epochs",1184        "posts_count": 5,1185        "reply_count": 3,1186        "highest_post_number": 5,1187        "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/6/c/6cf1deea54130767dd867db4827e1505ce26e24b_2_1024x817.jpeg",1188        "created_at": "2025-01-16T17:42:58.865Z",1189        "last_posted_at": "2025-01-17T15:02:23.101Z",1190        "bumped": true,1191        "bumped_at": "2025-01-17T15:02:23.101Z",1192        "archetype": "regular",1193        "unseen": false,1194        "pinned": false,1195        "unpinned": null,1196        "visible": true,1197        "closed": false,1198        "archived": false,1199        "bookmarked": null,1200        "liked": null,

Showing the first 1,200 of 61706 lines. Download the file for the rest.