Skip to content

Commit

Permalink
fix criterion weight load error in notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
drprojects committed Aug 21, 2023
1 parent 423f154 commit fd0ba28
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions notebooks/demo_dales.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
"model = hydra.utils.instantiate(cfg.model)\n",
"\n",
"# Load pretrained weights from a checkpoint file\n",
"model = model.load_from_checkpoint(cfg.ckpt_path, net=model.net, criterion=None)\n",
"model.criterion = hydra.utils.instantiate(cfg.model).criterion\n",
"model = model.load_from_checkpoint(cfg.ckpt_path, net=model.net, criterion=model.criterion)\n",
"model = model.eval().cuda()"
]
},
Expand Down Expand Up @@ -370,4 +369,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
3 changes: 1 addition & 2 deletions notebooks/demo_kitti360.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
"model = hydra.utils.instantiate(cfg.model)\n",
"\n",
"# Load pretrained weights from a checkpoint file\n",
"model = model.load_from_checkpoint(cfg.ckpt_path, net=model.net, criterion=None)\n",
"model.criterion = hydra.utils.instantiate(cfg.model).criterion\n",
"model = model.load_from_checkpoint(cfg.ckpt_path, net=model.net, criterion=model.criterion)\n",
"model = model.eval().cuda()"
]
},
Expand Down
5 changes: 2 additions & 3 deletions notebooks/demo_s3dis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
"model = hydra.utils.instantiate(cfg.model)\n",
"\n",
"# Load pretrained weights from a checkpoint file\n",
"model = model.load_from_checkpoint(cfg.ckpt_path, net=model.net, criterion=None)\n",
"model.criterion = hydra.utils.instantiate(cfg.model).criterion\n",
"model = model.load_from_checkpoint(cfg.ckpt_path, net=model.net, criterion=model.criterion)\n",
"model = model.eval().cuda()"
]
},
Expand Down Expand Up @@ -370,4 +369,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}

0 comments on commit fd0ba28

Please sign in to comment.