Commit 9d61831e authored by Yanghan Wang's avatar Yanghan Wang Committed by Facebook GitHub Bot
Browse files

remove legacy code from beginner.ipynb

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/375

`patch_d2_meta_arch` had already been removed in D37246483 (https://github.com/facebookresearch/d2go/commit/d1518ff66205089115df56010e8eafcf94efb08d), need to also update the `beginner.ipynb`.

Reviewed By: itomatik

Differential Revision: D39861148

fbshipit-source-id: bac80efbff1f99a023d604a66c3667bc94f8c6f4
parent fc3a3983
......@@ -31,9 +31,13 @@ jobs:
pip install git+https://github.com/facebookresearch/detectron2.git
pip install git+https://github.com/facebookresearch/mobile-vision
pip install scikit-learn
pip install pytest
pip install pytest nbval
pip install -e .
- name: Run pytest
run: |
python -m unittest discover -v -s tests
- name: Test Notebooks
run: |
find . -name *.ipynb | CI=true xargs pytest --nbval-lax --current-env
......@@ -531,6 +531,7 @@
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from d2go.runner import GeneralizedRCNNRunner\n",
"\n",
"\n",
......@@ -543,9 +544,10 @@
" cfg.DATASETS.TEST = (\"balloon_val\",)\n",
" cfg.DATALOADER.NUM_WORKERS = 2\n",
" cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(\"faster_rcnn_fbnetv3a_C4.yaml\") # Let training initialize from model zoo\n",
" cfg.MODEL.DEVICE = \"cpu\" if ('CI' in os.environ) else \"cuda\"\n",
" cfg.SOLVER.IMS_PER_BATCH = 2\n",
" cfg.SOLVER.BASE_LR = 0.00025 # pick a good LR\n",
" cfg.SOLVER.MAX_ITER = 600 # 600 iterations seems good enough for this toy dataset; you will need to train longer for a practical dataset\n",
" cfg.SOLVER.MAX_ITER = 5 if ('CI' in os.environ) else 600 # 600 iterations seems good enough for this toy dataset; you will need to train longer for a practical dataset\n",
" cfg.SOLVER.STEPS = [] # do not decay learning rate\n",
" cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 128 # faster, and good enough for this toy dataset (default: 512)\n",
" cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1 # only has one class (ballon). (see https://detectron2.readthedocs.io/tutorials/datasets.html#update-the-config-for-new-datasets)\n",
......@@ -609,7 +611,6 @@
"from detectron2.data import build_detection_test_loader\n",
"from d2go.export.exporter import convert_and_export_predictor\n",
"from d2go.utils.testing.data_loader_helper import create_detection_data_loader_on_toy_dataset\n",
"from d2go.export.d2_meta_arch import patch_d2_meta_arch\n",
"\n",
"import logging\n",
"\n",
......@@ -617,8 +618,6 @@
"previous_level = logging.root.manager.disable\n",
"logging.disable(logging.INFO)\n",
"\n",
"patch_d2_meta_arch()\n",
"\n",
"cfg_name = 'faster_rcnn_fbnetv3a_dsmask_C4.yaml'\n",
"pytorch_model = model_zoo.get(cfg_name, trained=True, device='cpu')\n",
"pytorch_model.eval()\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