Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Differential Revision: D18047206

fbshipit-source-id: 387070b12a292bd7fbd53b15318f7528a8748652
  • Loading branch information
ppwwyyxx authored and facebook-github-bot committed Oct 21, 2019
1 parent 62522b6 commit 8ef429d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ Note: you may need to rebuild detectron2 after reinstalling a different build of
not match the version of cuda you are running with.
This happens sometimes when using anaconda.

+ "Not compiled with GPU support": make sure
```
python -c 'import torch; from torch.utils.cpp_extension import CUDA_HOME; print(torch.cuda.is_available(), CUDA_HOME)'
```
print valid outputs at the time you build detectron2.

+ "invalid device function": you build detectron2 with one version of CUDA but run it with a different version.
4 changes: 2 additions & 2 deletions detectron2/modeling/box_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def apply_deltas(self, deltas, boxes):
box transformations for the single box boxes[i].
boxes (Tensor): boxes to transform, of shape (N, 4)
"""
assert torch.isfinite(deltas).all().item()
assert torch.isfinite(deltas).all().item(), "Box regression deltas become infinite or NaN!"
boxes = boxes.to(deltas.dtype)

widths = boxes[:, 2] - boxes[:, 0]
Expand Down Expand Up @@ -179,7 +179,7 @@ def apply_deltas(self, deltas, boxes):
boxes (Tensor): boxes to transform, of shape (N, 5)
"""
assert deltas.shape[1] == 5 and boxes.shape[1] == 5
assert torch.isfinite(deltas).all().item()
assert torch.isfinite(deltas).all().item(), "Box regression deltas become infinite or NaN!"

boxes = boxes.to(deltas.dtype)

Expand Down
2 changes: 2 additions & 0 deletions docs/tutorials/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ cfg.merge_from_file("my_cfg.yaml") # load values from a file
cfg.merge_from_list(["MODEL.WEIGHTS", "weights.pth"]) # can also load values from a list of str
```

To see a list of available configs in detectron2, see [Config References](../modules/config.html#config-references)


### Best Practice with Configs

Expand Down
4 changes: 3 additions & 1 deletion docs/tutorials/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ from detectron2.modeling import build_model
model = build_model(cfg) # returns a torch.nn.Module
```

To load a existing checkpoint to the model, use
To load an existing checkpoint to the model, use
`DetectionCheckpointer(model).load(file_path)`.
Detectron2 recognizes models in pytorch's `.pth` format, as well as the `.pkl` files
in our model zoo.

You can use a model by just `outputs = model(inputs)`.
Next, we explain the inputs/outputs format used by the builtin models in detectron2.
Expand Down

0 comments on commit 8ef429d

Please sign in to comment.