Skip to content

Commit

Permalink
update d2go_beginner.ipynb for exporting model
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #155

- remove tracing, which shouldn't affect anything.
- create the model in cpu mode, since it might have issue casting model.

Reviewed By: zhanghang1989

Differential Revision: D33357269

fbshipit-source-id: 27a0330ebb12b993744dee47151c3056cd584ccf
  • Loading branch information
wat3rBro authored and facebook-github-bot committed Dec 30, 2021
1 parent 30cf78b commit 06f3f2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demo/d2go_beginner.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,14 @@
"patch_d2_meta_arch()\n",
"\n",
"cfg_name = 'faster_rcnn_fbnetv3a_dsmask_C4.yaml'\n",
"pytorch_model = model_zoo.get(cfg_name, trained=True)\n",
"pytorch_model.cpu()\n",
"pytorch_model = model_zoo.get(cfg_name, trained=True, device='cpu')\n",
"pytorch_model.eval()\n",
"\n",
"with create_fake_detection_data_loader(224, 320, is_train=False) as data_loader:\n",
" predictor_path = convert_and_export_predictor(\n",
" model_zoo.get_config(cfg_name),\n",
" copy.deepcopy(pytorch_model),\n",
" \"torchscript_int8@tracing\",\n",
" \"torchscript_int8\",\n",
" './',\n",
" data_loader,\n",
" )\n",
Expand Down

0 comments on commit 06f3f2e

Please sign in to comment.