Skip to content

Commit

Permalink
Small fix to tutorial
Browse files Browse the repository at this point in the history
Summary: Small fix to `fit_textured_mesh.ipynb` tutorial due to a recent change in numpy

Reviewed By: bottler

Differential Revision: D29219990

fbshipit-source-id: f5feeef9eb952720ea7154d066795fbbe64ce7a1
  • Loading branch information
nikhilaravi authored and facebook-github-bot committed Jun 18, 2021
1 parent 029a9da commit a343cf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/tutorials/deform_source_mesh_to_target_mesh.ipynb
Expand Up @@ -406,10 +406,10 @@
" loop.set_description('total_loss = %.6f' % loss)\n",
" \n",
" # Save the losses for plotting\n",
" chamfer_losses.append(loss_chamfer)\n",
" edge_losses.append(loss_edge)\n",
" normal_losses.append(loss_normal)\n",
" laplacian_losses.append(loss_laplacian)\n",
" chamfer_losses.append(float(loss_chamfer.detach().cpu()))\n",
" edge_losses.append(float(loss_edge.detach().cpu()))\n",
" normal_losses.append(float(loss_normal.detach().cpu()))\n",
" laplacian_losses.append(float(loss_laplacian.detach().cpu()))\n",
" \n",
" # Plot mesh\n",
" if i % plot_period == 0:\n",
Expand Down
9 changes: 5 additions & 4 deletions docs/tutorials/fit_textured_mesh.ipynb
Expand Up @@ -46,8 +46,8 @@
"id": "okLalbR_g7NS"
},
"source": [
"Ensure `torch` and `torchvision` are installed. If `pytorch3d` is not installed, install it using the following cell:"
]
"Ensure `torch` and `torchvision` are installed. If `pytorch3d` is not installed, install it using the following cell:"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -645,7 +645,8 @@
" sum_loss = torch.tensor(0.0, device=device)\n",
" for k, l in loss.items():\n",
" sum_loss += l * losses[k][\"weight\"]\n",
" losses[k][\"values\"].append(l)\n",
" losses[k][\"values\"].append(float(l.detach().cpu()))\n",
"\n",
" \n",
" # Print the losses\n",
" loop.set_description(\"total_loss = %.6f\" % sum_loss)\n",
Expand Down Expand Up @@ -829,7 +830,7 @@
" sum_loss = torch.tensor(0.0, device=device)\n",
" for k, l in loss.items():\n",
" sum_loss += l * losses[k][\"weight\"]\n",
" losses[k][\"values\"].append(l)\n",
" losses[k][\"values\"].append(float(l.detach().cpu()))\n",
" \n",
" # Print the losses\n",
" loop.set_description(\"total_loss = %.6f\" % sum_loss)\n",
Expand Down

0 comments on commit a343cf5

Please sign in to comment.