Commit 06f3f2e8 authored by Yanghan Wang's avatar Yanghan Wang Committed by Facebook GitHub Bot
Browse files

update d2go_beginner.ipynb for exporting model

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/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
parent 30cf78be
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment