profile
viewpoint
Yuxin Wu ppwwyyxx http://ppwwyyxx.com Working on computer vision @facebookresearch, as well as @tensorpack

megvii-research/neural-painter 535

Paint artistic patterns using random neural network

ppwwyyxx/Adversarial-Face-Attack 314

Black-Box Adversarial Attack on Public Face Recognition Systems

ppwwyyxx/dash-docset-tensorflow 184

dash/zeal docset for tensorflow

curimit/SugarCpp 133

SugarCpp is a language which can compile to C++11.

ppwwyyxx/GroupNorm-reproduce 96

An official collection of code in different frameworks that reproduces experiments in "Group Normalization"

ppwwyyxx/dotfiles 39

my dotfiles..

ppwwyyxx/dotvim 34

Over 1200+ lines of vimrc

ppwwyyxx/FRN-on-common-ImageNet-baseline 29

Filter Response Normalization tested on better ImageNet baselines.

ppwwyyxx/dash-docset-matlab 19

Generate Dash Docset for Matlab

ppwwyyxx/haDNN 19

Proof-of-Concept CNN in Halide

issue closedfacebookresearch/detectron2

Running deployed model inference

Hello,

I am trying to run inference using deploy guide from here https://detectron2.readthedocs.io/tutorials/deployment.html. but this guide is not clear and I couldn't complete it.

I managed to create model.pb, model_init.pb. The guide from above also says this:

To use the converted model in python, we provide a python wrapper around the converted model, in the Caffe2Model.call method. This method has an interface that’s identical to the pytorch versions of models so I tried it like this:

from detectron2.export import Caffe2Model import cv2

model = Caffe2Model.load_protobuf("./") im = cv2.imread("../valid/1.jpg") inputs = [{"image": im)}] outputs = model(inputs)

this does not work and I get AttributeError: 'numpy.ndarray' object has no attribute 'dim' so I tried this:

import cv2

model = Caffe2Model.load_protobuf("./") im = cv2.imread("../valid/1.jpg") inputs = [{"image": torch.from_numpy(im))}] outputs = model(inputs)

this also does not work: I get: assert bbox_nms is not None AssertionError

This particular image runs fine during caffe_converter evaluation.

Is there a chance you can help me with this?

closed time in 8 hours

juvebogdan

issue commentfacebookresearch/detectron2

Running deployed model inference

As the guide says, the input should follow the format in https://detectron2.readthedocs.io/tutorials/models.html#model-input-format. The inputs you provided do not follow the format.

If you need more help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

juvebogdan

comment created time in 8 hours

issue closedfacebookresearch/detectron2

How to interpret the visibility score output from keypoint output

During labeling/dataset creation, the visibility flag for a keypoint is set according to:

The visibility flag follows the COCO format and must be one of three integers: * v=0: not labeled (in which case x=y=0) * v=1: labeled but not visible * v=2: labeled and visible

I am not sure how to interpret the visibility score for predicted keypoints. In my custom training labels, I have all non-labeled points set to x=0,y=0,v=0 as per the above COCO guideline. I do not use v=1 because I don't ever label invisible keypoints.

At inference time, what is the correct way to filter out keypoints that are invisible (i.e. outside the image frame)? Most of my objects have at least one keypoint outside of the image frame. I am getting false positive keypoints often at the edge of the image (but not outside the image frame). At first I tried thresholding by the output visibility value but I found that many true positive visible keypoints have very low predicted visibility values (e.g. 0.1). Therefore, thresholding doesn't seem to be reliable.

I notice the visualizer filter out keypoints that have visibility score under certain threshold:

_KEYPOINT_THRESHOLD = 0.05 Source: https://github.com/facebookresearch/detectron2/blob/master/detectron2/utils/visualizer.py#L33

How is 0.05 determined? It seems like a magic number to me.

My real question is how to I reliably filter out invisible keypoints at inference time?

closed time in 8 hours

jackkwok

issue commentfacebookresearch/detectron2

How to interpret the visibility score output from keypoint output

The model does not output visibility score. Outputs are described in https://detectron2.readthedocs.io/tutorials/models.html#model-output-format - it's just a confidence score.

jackkwok

comment created time in 8 hours

issue openedfacebookresearch/hydra

[Bug] Recursive default list + Package overrides

🐛 Bug

Description

Recursive default List + Package overrides not working. A continuation of https://github.com/facebookresearch/hydra/issues/171#issuecomment-719106222

To reproduce

Configs:

# model/maskrcnn.yaml:
# @package _group_
a: 1
b: 2

# model/maskrcnn2.yaml:
# @package _group_
b: 3
c: 4

defaults:
  - model/maskrcnn   # ??
  - _self_

# main.yaml:
defaults:
  - model@model.submodule: maskrcnn2

Code:

@hydra.main(config_name="main")
def my_app(cfg: DictConfig) -> None:
    print(cfg)

if __name__ == "__main__":
    my_app()

It gives me:

{'model': {'a': 1, 'b': 2, 'submodule': {'b': 3, 'c': 4}}}

Expected Behavior

I expect to get an equivalent of

model:
  submodule:
    a: 1
    b: 3
    c: 4

System information

  • Hydra Version : master
  • Python version : 3.8.6

created time in 15 hours

issue commentfacebookresearch/hydra

Recursive defaults support

I can't seem to make the above example work with the commit that's just added. I ended up with

{'model': {'a': 1, 'b': 2, 'submodule': {'b': 3, 'c': 4}}}
omry

comment created time in 16 hours

issue commentfacebookresearch/detectron2

NotImplementedError in training for instance segmentation

File "/usr/local/lib/python3.6/dist-packages/detectron2/structures/masks.py", line 204, in get_bounding_boxes raise NotImplementedError

The master branch doesn't even have this line of code: https://github.com/facebookresearch/detectron2/blob/29e85f9a21e57f883de1e4dac09392c833f19ab2/detectron2/structures/masks.py#L202, so it's impossible to produce the same error.

If you run into other errors, please open new issues and include details following the "Unexpected behaviors" issue template.

Randheerkumar

comment created time in a day

issue closedfacebookresearch/detectron2

How to display bounding box on Android?

❓ How to do something using detectron2

Hello! I'd like to take the bounding box shown in the output from detectron2 after prediction, and display that on an Android application as a bounding box over an image. Can anyone guide me on how this can be done? Or is there a standardized way to doing this?

This is what my bounding box looks like: Boxes(tensor([[ 20.3178, 0.0000, 219.9704, 166.3912],\n [ 35.7135, 0.0000, 214.5163, 163.8396]]))

closed time in a day

KhyatiMehta3

issue commentfacebookresearch/detectron2

How to display bounding box on Android?

Detectron2 is responsible for making the predictions, which you already obtain. How to display it on android is not within the scope of this project.

KhyatiMehta3

comment created time in a day

issue commentfacebookresearch/detectron2

Inference on CPU for models with Deformable conv layer

@PurveshChhajed Your question was answered in #2180 and please refrain from commenting on unrelated issues.

grovPri

comment created time in a day

issue closedfacebookresearch/detectron2

Inference running more slowly than expected on Azure

Hello @ppwwyyxx, this is a continuation of Issue 2166, but I couldn't figure out how to reopen that one. Please allow this issue to stay open until resolved. I have clearly identified a real problem that has nothing to do with my code. Detectron2 runs more than 20X slower than it should on Azure's standard NC (version 1) machines, and probably slower than it should on Azure NC_v2 machines as well. That difference holds no matter whether the environment is containerized or not, whether the code is run on the Azure Machine Learning cluster machine, on a VM running a Jupyter Notebook, or running on the commandline inside a container. Of course, it could be Microsoft's fault -- I don't know -- but I think that it should be flagged as a problem since Azure is one of the biggest ML platforms in the world.

<pre>

+------------------------------+--------------------------------------------------------------+ | | Machine type | +------------------------------+-------------------+--------------------+---------------------+ | Run setup | Azure NC6 (v1) | Azure NC6_v2 | Google Colab | | | Tesla K80 GPU | Tesla P100 GPU | Tesla K80 or T4 GPU | +------------------------------+-------------------+--------------------+---------------------+ | Azure VM (DSVM) | 3.6 s/image (CPU) | | | | run from | 0.9 s/image (GPU) | | | | Jupyter Notebook | | | | +------------------------------+-------------------+--------------------+---------------------+ | Azure VM (DSVM); | | | | | Containerized code | 3.6 s/image (CPU) | | | | run from command line | 0.9 s/image (GPU) | | | | inside the running container | | | | +------------------------------+-------------------+--------------------+---------------------+ | Azure Machine Learning | | | | | “cluster” machine, | 0.9 s/image (GPU) | 0.22 s/image (GPU) | | | containerized environment; | | | | | script is run | | | | | via Python SDK | | | | +------------------------------+-------------------+--------------------+---------------------+ | Google Colab (free tier) | | | 0.04 s/image | | run via notebook | | | (the same result | | | | | was obtained by | | | | | Detectron2 support | | | | | and myself) | +------------------------------+-------------------+--------------------+---------------------+

</pre>

All machines were running Linux 18.04; all using only the same small set of imported Python packages; all using the same run script. The model setup was bare-bones and the script just did inference on 10 fake 500x500 images; there was no I/O involved since the script created the test images in memory. The Dockerfile used for the containerized environment included the same set of Python packages as used on the VMs, plus 'azureml-sdk', which is the Python SDK used to communicate with AML cluster machines.

Here is the Dockerfile I used for the Azure cluster machine. 'dev_packages' includes TridentNet (copied from the Facebook website) and the run script.

FROM mcr.microsoft.com/azureml/openmpi3.1.2-cuda10.1-cudnn7-ubuntu18.04
RUN apt-get update
RUN apt-get install 'ffmpeg' 'libsm6' 'libxext6'  -y
RUN pip install torch==1.6 torchvision==0.7
RUN pip install cython pyyaml==5.1 'pycocotools>=2.0.1'
RUN pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.6/index.html
RUN pip install opencv-python 
RUN pip install pathlib
RUN pip install jupyterlab
RUN pip install --upgrade azureml-sdk
RUN pip install azureml-datadrift
RUN pip install azureml-train-automl
RUN pip install azureml-interpret
COPY ./dev_packages /

<put logs here>

closed time in 2 days

jcpayne

issue commentfacebookresearch/detectron2

Inference running more slowly than expected on Azure

Unless there is any evidence we cannot consider it as a detectron2 issue, so I'm still closing. Please also note that your original benchmark script in #2166 is incorrect - the time for the first few iterations should be excluded until the time per step stabilizes.

jcpayne

comment created time in 2 days

issue commentfacebookresearch/detectron2

Inference running more slowly than expected on Azure

If the same code runs slower on Azure's machines, you should probably ask Azure. I'm not sure there is anything we could do to help.

jcpayne

comment created time in 2 days

issue closedtensorpack/tensorpack

Could not reproduce imagenet-resnet50 accuracy using keras

Hi Tensorpack team!

I'm trying to reproduce resnet50 validation accuracy (75%) using the code in: https://github.com/tensorpack/tensorpack/blob/master/examples/keras/imagenet-resnet-keras.py running on 8 titanx gpus, with TOTAL_BATCH_SIZE=512. First experiments use the code as is. Maximal validation accuracy is 71.5%. Second experiments add weight decay as described here with alpha=1e-5. Still same accuracy. Is there anything I should change in the code / environment in order to get the 75%? Thanks, Yochay

closed time in 2 days

YochayTzur

issue commenttensorpack/tensorpack

Could not reproduce imagenet-resnet50 accuracy using keras

The keras example is now removed.

YochayTzur

comment created time in 2 days

push eventtensorpack/tensorpack

Yuxin Wu

commit sha 2d5707c036864d5938478a731d37c646fbd71823

remove keras-imagenet example

view details

push time in 2 days

issue closedtensorpack/tensorpack

Train VGG16

I have been trying to train the VGG Model using the vgg.py code. However, the Top5 Validation accuracy I am getting is very far from the reported. I am currently using the following settings: --batch 128 --gpu 4 --norm bn

Please can you provide the settings used during training for the values reported in the repository?

Is it possible to get a model of the VGG model trained with --norm = bn in the model zoo?

Also, what does --batch parameter?

Is it the number of batch per gpu or the total batch size? The github said something about using batch size of 32 per gpu for the training. This is equivalent to 32*8 for all the GPUs. does it mean batch size is 32 or 256?

Thank you.

closed time in 2 days

omobayode1

issue commenttensorpack/tensorpack

Train VGG16

Settings are given in https://github.com/tensorpack/tensorpack/tree/master/examples/ImageNetModels#vgg16 already. We don't plan to release the models.

what does --batch parameter?

The above link also says: see ./vgg16.py --help for usage.

omobayode1

comment created time in 2 days

issue closedfacebookresearch/detectron2

How To Train On Multi-Category Keypoint Dataset (COCO Format)

I am familiar with how to train a keypoint model with a single category. Single Category Example: <details> <summary>Show Single Category Example ('categories' value in COCO dataset)</summary>

'categories': [
  {
    "id": 0,
    "supercategory": "primary",
    "name": "object0",
    "keypoints": [
      "a",
      "b",
      "c",
      "d"
    ],
    "skeleton": [
      [
        0,
        1
      ],
      [
        1,
        2
      ],
      [
        2,
        3
      ],
      [
        1,
        3
      ],
      [
        0,
        3
      ]
    ]
  }
]

</details>

The documents explain how to setup metadata for a single category. (ref.)

kpt_label_list, kpt_skeleton, class_name_list = _get_kpt_info()
MetadataCatalog.get(instance_name).thing_classes = ['object0']
MetadataCatalog.get(instance_name).keypoint_names = ['a', 'b', 'c', 'd']
MetadataCatalog.get(instance_name).keypoint_flip_map = []
MetadataCatalog.get(instance_name).keypoint_connection_rules = [
    ['a', 'b', (0, 0, 255)], ['b', 'c', (0, 0, 255)], ['c', 'd', (0, 0, 255)],
    ['b', 'd', (0, 0, 255)], ['a', 'd', (0, 0, 255)]
]

But how would I setup the metadata for multiple objects, each with a different set of keypoints? Multi-Category Example: <details> <summary>Show Multiple Category Example ('categories' value in COCO dataset)</summary>

'categories': [ { "id": 0, "supercategory": "primary", "name": "object0", "keypoints": [ "a", "b", "c", "d" ], "skeleton": [ [ 0, 1 ], [ 1, 2 ], [ 2, 3 ], [ 1, 3 ], [ 0, 3 ] ] }, { "id": 1, "supercategory": "secondary", "name": "object1", "keypoints": [ "v", "w", "x", "y", "z" ], "skeleton": [ [ 0, 3 ], [ 1, 3 ], [ 2, 4 ], [ 1, 2 ] ] } ]

</details>

In the above example, object0 and object1 have different keypoint names and a different skeleton. The total number of keypoints is also different. It seems to me like it is possible to define multiple thing_classes, but there can only be one keypoint_connection_rules. Is there a way to define multiple keypoint_connection_rules for the same model?

closed time in 2 days

cm107

issue commentfacebookresearch/detectron2

How To Train On Multi-Category Keypoint Dataset (COCO Format)

keypoint_connection_rules is the last thing to worry about since it only affects visualization of results.

Duplicate of #1415

cm107

comment created time in 2 days

issue commentfacebookresearch/detectron2

cannot build detectron2

As mentioned above, there are NVCC and GCC versions that are incompatible with each other. We don't have a complete list of all such incompatible versions.

MPForte

comment created time in 3 days

PR opened facebookresearch/detectron2

pytorch 1.7 CI
+33 -20

0 comment

3 changed files

pr created time in 3 days

push eventfacebookresearch/detectron2

Yuxin Wu

commit sha 2b102699518a6c78e6a7938df6a15e2528d11613

update

view details

push time in 3 days

issue commentfacebookresearch/detectron2

torch version upgrade

Thanks! I added the new command to the tutorial.

Warday

comment created time in 3 days

push eventfacebookresearch/detectron2

Yuxin Wu

commit sha 07648e8ce44f53d941554f3e0d3ad3f3c50ff0f5

fix tests

view details

push time in 3 days

issue openedpytorch/pytorch

torch.jit.Final does not work in Pytorch1.7 + Python3.6

🐛 Bug

To Reproduce

# Dockerfile
FROM python:3.6-slim-buster
USER root
WORKDIR /root
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install torch==1.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
COPY a.py /
RUN python3 /a.py

# a.py:
import torch
from torch import nn

class A(nn.Module):
    dim: torch.jit.Final[int] = 4

    def __init__(self):
        super().__init__()
        self.l = nn.Linear(10, 10)

    def forward(self, x):
        return self.l(x)


class B(nn.Module):
    def __init__(self):
        super().__init__()
        self.a = A()

    def forward(self, x):
        return self.a(x) + self.a.dim

b = B()
b = torch.jit.script(b)

Error:

Traceback (most recent call last):
  File "/a.py", line 24, in <module>
    b = torch.jit.script(b)
  File "/usr/local/lib/python3.6/site-packages/torch/jit/_script.py", line 898, in script
    obj, torch.jit._recursive.infer_methods_to_compile
  File "/usr/local/lib/python3.6/site-packages/torch/jit/_recursive.py", line 352, in create_script_module
    return create_script_module_impl(nn_module, concrete_type, stubs_fn)
  File "/usr/local/lib/python3.6/site-packages/torch/jit/_recursive.py", line 410, in create_script_module_impl
    create_methods_and_properties_from_stubs(concrete_type, method_stubs, property_stubs)
  File "/usr/local/lib/python3.6/site-packages/torch/jit/_recursive.py", line 304, in create_methods_and_properties_from_stubs
    concrete_type._create_methods_and_properties(property_defs, property_rcbs, method_defs, method_rcbs, method_defaults)
RuntimeError: 
Module 'A' has no attribute 'dim' :
  File "/a.py", line 21
    def forward(self, x):
        return self.a(x) + self.a.dim
                           ~~~~~~~~~~ <--- HERE

It works if we change 3.6 to 3.7.

created time in 3 days

push eventfacebookresearch/detectron2

Yuxin Wu

commit sha 842515f920a59d4fe3da0b2a06aa6e1d7bd21c3c

clear cache before scripting instances Summary: required for tests to pass with pytorch1.7 (released today) Reviewed By: alexander-kirillov Differential Revision: D24575698 fbshipit-source-id: d0c86edf1543cd648e7943683a690510348dbe7a

view details

Yuxin Wu

commit sha cfcf40c4ecf712df4c7a7f341b45448241621fba

CI for pytorch1.7

view details

Yuxin Wu

commit sha ba7012c93c910afcb52a8584c93584a5f8ed5c55

reinstall dep; serialize mac

view details

Yuxin Wu

commit sha 2bc82bd9910548dff4882bb6a9d565cde89e852b

install correct torchvision

view details

push time in 3 days

push eventfacebookresearch/detectron2

Yuxin Wu

commit sha c5f1adccdc363cd2ab458c721c53f72bb16b61fe

reinstall dep; serialize mac

view details

push time in 3 days

issue closedfacebookresearch/detectron2

Model will not train on multiple GPUs

Hi, I am trying to train an object detection model on a custom dataset, in a jupyterlab environment. I have 8 GPUs available. I followed the suggestion in https://github.com/facebookresearch/detectron2/issues/719 and other issues. The model however will not use any GPU beyond the first, as evidenced by the nvidia-smi command. Trying to use larger batch sizes results in CUDA out of memory errors

Instructions To Reproduce the Issue:

Cannot be runned directly due to the custom dataset, but here is the complete code. I have tried multiple values for cfg.SOLVER.IMS_PER_BATCH, mostly resulting in out of memory errors.

import detectron2
from detectron2.utils.logger import setup_logger
setup_logger()
import numpy as np
import os, json, cv2, random
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.data import MetadataCatalog, DatasetCatalog
from detectron2.data.datasets import register_coco_instances
from detectron2.engine import DefaultTrainer, launch

register_coco_instances("VisDrone_train", {}, "training.json", "/workspace/bind_mount/Dataset/VisDrone/VisDrone2019-DET-train/images/")
register_coco_instances("VisDrone_val", {}, "validation.json", "/workspace/bind_mount/Dataset/VisDrone/VisDrone2019-DET-val/images/")

def main_train():
    cfg = get_cfg()
    cfg.merge_from_file(model_zoo.get_config_file("COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml"))
    cfg.DATASETS.TRAIN = ("VisDrone_train",)
    cfg.DATASETS.TEST = ("VisDrone_val",)
    cfg.DATALOADER.NUM_WORKERS = 20
    cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml")  
    cfg.SOLVER.IMS_PER_BATCH = 1
    cfg.SOLVER.BASE_LR = 0.00025 
    cfg.SOLVER.MAX_ITER = 3000    
    cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 512   
    cfg.MODEL.ROI_HEADS.NUM_CLASSES = 12 

    os.makedirs(cfg.OUTPUT_DIR, exist_ok=True)
    trainer = DefaultTrainer(cfg) 
    trainer.resume_or_load(resume=False)
    return trainer.train()

launch(main_train(), 8, num_machines=1, machine_rank=0, dist_url=None)

Expected behavior:

The training should take place on all 8 GPUs and larger batch sizes should not produce out of memory.

Environment:

----------------------  -------------------------------------------------------------------
sys.platform            linux
Python                  3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31) [GCC 7.3.0]
numpy                   1.16.4
detectron2              0.2.1 @/opt/conda/lib/python3.6/site-packages/detectron2
Compiler                GCC 7.3
CUDA compiler           CUDA 10.1
detectron2 arch flags   sm_35, sm_37, sm_50, sm_52, sm_60, sm_61, sm_70, sm_75
DETECTRON2_ENV_MODULE   <not set>
PyTorch                 1.6.0+cu101 @/opt/conda/lib/python3.6/site-packages/torch
PyTorch debug build     False
GPU available           True
GPU 0,1,2,3,4,5,6,7     Tesla V100-SXM2-16GB
CUDA_HOME               /usr/local/cuda
Pillow                  8.0.0
torchvision             0.7.0+cu101 @/opt/conda/lib/python3.6/site-packages/torchvision
torchvision arch flags  sm_35, sm_50, sm_60, sm_70, sm_75
fvcore                  0.1.2.post20201020
cv2                     3.4.1
----------------------  -------------------------------------------------------------------
PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2019.0.5 Product Build 20190808 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.5.0 (Git Hash e2ac1fac44c5078ca927cb9b90e1b3066a0b2ed0)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 10.1
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75
  - CuDNN 7.6.3
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF, 

closed time in 3 days

fColangelo

issue commentfacebookresearch/detectron2

Model will not train on multiple GPUs

See documentation and the example training script https://github.com/facebookresearch/detectron2/blob/43fc8650eaa5f3044a6896de8e34c18ae4a6b3f5/tools/train_net.py#L164

launch takes a function as the first argument.

fColangelo

comment created time in 3 days

push eventfacebookresearch/detectron2

consti

commit sha ae7199c0b4006e23f58b73cf962c20bc7f7d5dd0

Bitmask tight bounding boxes Summary: Just implement bit mask get_bounding_boxes function Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/1758 Reviewed By: rbgirshick Differential Revision: D22819218 Pulled By: ppwwyyxx fbshipit-source-id: 702c6fe4fa5273d078623b9ba6f70088775a76b9

view details

Yuxin Wu

commit sha 7f06f5383421b847d299b8edf480a71e2af66e63

add PT1.6 to CI Summary: Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/1844 Reviewed By: rbgirshick Differential Revision: D22849342 Pulled By: ppwwyyxx fbshipit-source-id: 2936d2eec07c5e43d142388c842d81dd60c0c212

view details

Yuxin Wu

commit sha f8dad51b5aca66987b175e12ba99f43859a18d8b

build for pytorch 1.6 Summary: Pull Request resolved: https://github.com/fairinternal/detectron2/pull/439 Reviewed By: rbgirshick Differential Revision: D22860556 Pulled By: ppwwyyxx fbshipit-source-id: 8819a28f3defbda2cf42b9416232ac7ca0516f55

view details

Yuxin Wu

commit sha e1252f9aab632a23c40787caf700745a2e285a58

write scalars added at any period Summary: Previously, only scalars added at the exact steps (e.g. N * 20) will be saved. This causes issues T65536602 and https://github.com/facebookresearch/detectron2/issues/1714 This diff will expose scalars added at earlier steps to writers. JSONWriter and TensorboardXWriter will check that they have not seen the data in the past before writing, so they don't write the same data twice. Reviewed By: rbgirshick Differential Revision: D22915391 fbshipit-source-id: 2bb776319be7d5d261c3903e91eedb5b11c29e97

view details

Yuxin Wu

commit sha 45e0d28ea38a4fd208a0ccab4d6b827aed0bd7c4

documentation changes Reviewed By: rbgirshick Differential Revision: D22977939 fbshipit-source-id: 002453fb97b4f7e568017e8e5cde793490f5b812

view details

Yuxin Wu

commit sha a780cefabcb427b040e1f2811e0a73f8a35c8b1e

fix INSTALL.md Summary: Pull Request resolved: https://github.com/fairinternal/detectron2/pull/441 Reviewed By: alexander-kirillov Differential Revision: D22992850 Pulled By: ppwwyyxx fbshipit-source-id: 222f1f78fdf756543eb3db9c2bf961625879458a

view details

Feiyang Chen

commit sha dc2cdc33663381f68672fc05a4ba9325083f02ec

Update README.md Summary: Add a Few-Shot Object Detection project link builts on top of detectron2. Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/1837 Reviewed By: alexander-kirillov Differential Revision: D23011924 Pulled By: ppwwyyxx fbshipit-source-id: 8e6d62c72492ebd8a527e93143adb05a6b354169

view details

sarthakforwet

commit sha 8cf31b794435c0065665462376e5a5bb487c4755

Getting Started: updated note in "Training and Evaluation in Command Line" Summary: Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/1827 Reviewed By: alexander-kirillov Differential Revision: D23011996 Pulled By: ppwwyyxx fbshipit-source-id: 11dda4754bbcd0fa8ee51f947d8f51aa583d9202

view details

ibelyalov@yandex.ru

commit sha 15b1f02a020c97e17780370391b0794c65691987

Clarify about config wrt "resume" option Summary: Just a little clarification on 'resume' option Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/1217 Reviewed By: alexander-kirillov Differential Revision: D23021569 Pulled By: ppwwyyxx fbshipit-source-id: 9b5124f39628b1f273160f3d9831f46cccde8da8

view details

Yuxin Wu

commit sha a3716115021010837ed6e7f8f0fc43691f4d0112

update docs Summary: Pull Request resolved: https://github.com/fairinternal/detectron2/pull/443 Reviewed By: alexander-kirillov Differential Revision: D23033589 Pulled By: ppwwyyxx fbshipit-source-id: 82bd2e55d4dd658447204254573a0f249c5cb356

view details

Vasil Khalidov

commit sha 773fffb39138499c400c29d03cbda5ead36bc2a5

more metrics in evaluation output Summary: Introduces several changes for proper segmentation evaluation: - extract `densepose_to_mask` method to reuse it in evaluation - perform `to_result` on densepose outputs *after* `densepose_to_mask` is called Adds segmentation and densepose metrics to the evaluation output: - segmentation: AP, AP50, AP75, APs, APm, APl, AR@1, AR@10, AR@100, ARs, ARm, ARl - densepose: AP, [AP20, AP30, AP40,] AP50, AP75, APm, APl, AR, AR50, AR75, ARm, ARl Reviewed By: MarcSzafraniec Differential Revision: D22725274 fbshipit-source-id: 8a3159cc92bf2a14f0321c42fb5e2aa811f2492d

view details

Yuxin Wu

commit sha 5b8f68436651c74608a3f4909cae570dbe23e51d

let pooler support zero image Reviewed By: alexander-kirillov Differential Revision: D23056798 fbshipit-source-id: b42ad8b6e96b212e271023ccafe6b963abad45b5

view details

Kan Chen

commit sha 006a23980541fc876095f3560adda15129a7b568

fix image format Summary: Error met when using test time augmentation in P138569013. Fix the problem by using `image_format` from `tta_mapper` Reviewed By: ppwwyyxx Differential Revision: D23079314 fbshipit-source-id: 2931a5cba0f6f26b37eddafaf7dfd03936559d3e

view details

Yuxin Wu

commit sha a7e07a6baaeeac3b3bc8dd1481d04e1f49c90ee5

make projects importable under detectron2.projects Summary: Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/1888 Pull Request resolved: https://github.com/fairinternal/detectron2/pull/442 Reviewed By: alexander-kirillov Differential Revision: D23004510 fbshipit-source-id: 53f86a21c072031c20f23c316d204f7c4bedd1af

view details

Yuxin Wu

commit sha 9fe2edaf6f22bb1c2069ec12b9089d19069e5286

rename imports of point_rend and deeplab Reviewed By: ytsheng Differential Revision: D23015493 fbshipit-source-id: 246c37a9cd913202e801e4e781adb63c4b74c224

view details

Yuxin Wu

commit sha b6eae861188e30496c1eeb700717ba4db344d72c

add option to select fast COCO api Reviewed By: rbgirshick Differential Revision: D23092461 fbshipit-source-id: 150cec21e641ef028d760308f0c6f90367f42bef

view details

Meghan Lele

commit sha 18b692f1cf384216f3dc9a5016b08c6b1ffab8eb

Add property support to TorchScript classes Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/42389 **Summary** This commit adds support for properties to TorchScript classes, specifically for getters and setters. They are implemented essentially as pointers to the methods that the corresponding decorators decorate, which are treated like regular class methods. Deleters for properties are considered to be out of scope (and probably useless for TorchScript anyway). **Test Plan** This commit adds a unit test for a class with a property that has both getter and setter and one that has only a getter. `python test/test_jit.py TestClassType.test_properties` Test Plan: Imported from OSS Reviewed By: eellison, ppwwyyxx Differential Revision: D22880232 Pulled By: SplitInfinity fbshipit-source-id: 4828640f4234cb3b0d4f3da4872a75fbf519e5b0

view details

Yuxin Wu

commit sha 3a1f9d9524457a0b73b5f13fdf8363d30da2aca5

support attribute access of scripted Instances Reviewed By: alexander-kirillov Differential Revision: D23143325 fbshipit-source-id: 2e8cc9a1efce2c8eb2166885a373410b4d5b963c

view details

chenbohua3

commit sha d0518a6aedf6336ed5d8a3c7662c86cd60c9e574

Remove hacks for boolean keys in dict Summary: https://github.com/pytorch/pytorch/pull/42833 boolean key in dictionary is now supported in pytorch1.7.0, so these hacks can be removed. Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/1897 Reviewed By: alexander-kirillov Differential Revision: D23142361 Pulled By: ppwwyyxx fbshipit-source-id: 677dc47ae6f65851e0173b2819199c47e0671752

view details

Yuxin Wu

commit sha 0af92994bc09a1ea256feb7a76f996cdc3930193

Fix unittest & C++ example for PT1.6 Summary: Pull Request resolved: https://github.com/fairinternal/detectron2/pull/444 Reviewed By: alexander-kirillov Differential Revision: D23147803 Pulled By: ppwwyyxx fbshipit-source-id: 1cd371fdccaa80eebc6ef89a655ed9b5ad984eec

view details

push time in 3 days

issue closedfacebookresearch/detectron2

errors during install the detectron2 under win10 system

When I install the detectron2 by running the command : python setup.py build --force develop, I got the reports as below: 1 I don't know how to solve it...Hope someone can help me, thanks in advance.

closed time in 3 days

lmw0320

issue commentfacebookresearch/detectron2

errors during install the detectron2 under win10 system

Answered in https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues that we do not provide support for windows.

lmw0320

comment created time in 3 days

issue commentfacebookresearch/detectron2

demo -- detected 0 instance

If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

haideshanmu

comment created time in 3 days

issue closedfacebookresearch/detectron2

TypeError: expected Tensor as element 0 in argument 0, but got int

Dear all, I used Denspose and I got the error: TypeError: expected Tensor as element 0 in argument 0, but got int

Instructions To Reproduce the Issue:

I make a clear installation by cloning Denspose from Github and install it following INSTALL.md and GETTING_STARTED.md.

  1. full Error
  File "apply_net.py", line 315, in <module>
    main()
  File "apply_net.py", line 311, in main
    args.func(args)
  File "apply_net.py", line 90, in execute
    outputs = predictor(img)["instances"]
  File "/opt/conda/lib/python3.7/site-packages/detectron2/engine/defaults.py", line 223, in __call__
    predictions = self.model([inputs])[0]
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/detectron2/modeling/meta_arch/rcnn.py", line 149, in forward
    return self.inference(batched_inputs)
  File "/opt/conda/lib/python3.7/site-packages/detectron2/modeling/meta_arch/rcnn.py", line 196, in inference
    images = self.preprocess_image(batched_inputs)
  File "/opt/conda/lib/python3.7/site-packages/detectron2/modeling/meta_arch/rcnn.py", line 222, in preprocess_image
    images = ImageList.from_tensors(images, self.backbone.size_divisibility)
  File "/opt/conda/lib/python3.7/site-packages/detectron2/structures/image_list.py", line 85, in from_tensors
    image_sizes = tuple(torch.stack(x) for x in image_sizes)
  File "/opt/conda/lib/python3.7/site-packages/detectron2/structures/image_list.py", line 85, in <genexpr>
    image_sizes = tuple(torch.stack(x) for x in image_sizes)
TypeError: expected Tensor as element 0 in argument 0, but got int

Anyone can help me?

closed time in 4 days

zahrahosseini99

issue commentfacebookresearch/detectron2

TypeError: expected Tensor as element 0 in argument 0, but got int

Please upgrade code to latest. If issues still exist, please include details following the "Unexpected behaviors" issue template.

zahrahosseini99

comment created time in 4 days

issue closedfacebookresearch/detectron2

Exception during training - NotImplementedError: Caught NotImplementedError in DataLoader worker process 0.

On running following piece of code :

from detectron2.engine import DefaultTrainer

cfg = get_cfg() cfg.INPUT.MASK_FORMAT='bitmask' #cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml")) cfg.merge_from_file(model_zoo.get_config_file("Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv.yaml")) cfg.DATASETS.TRAIN = ("v6",) cfg.DATASETS.TEST = () cfg.DATALOADER.NUM_WORKERS = 2 #cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml")# Let training initialize from model zoo cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv.yaml") cfg.SOLVER.IMS_PER_BATCH = 2 cfg.SOLVER.BASE_LR = 0.00025 # pick a good LR cfg.SOLVER.MAX_ITER = 3500 # 300 iterations seems good enough for this toy dataset; you will need to train longer for a practical dataset cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 128 # faster, and good enough for this toy dataset (default: 512) cfg.MODEL.ROI_HEADS.NUM_CLASSES = 300 os.makedirs(cfg.OUTPUT_DIR, exist_ok=True) trainer = DefaultTrainer(cfg) trainer.resume_or_load(resume=False) trainer.train()

got the following error :

[10/26 18:26:00 d2.engine.train_loop]: Starting training from iteration 0 /home/user1/.local/lib/python3.6/site-packages/detectron2/data/detection_utils.py:412: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:141.) torch.stack([torch.from_numpy(np.ascontiguousarray(x)) for x in masks]) ERROR [10/26 18:26:00 d2.engine.train_loop]: Exception during training: Traceback (most recent call last): File "/home/user1/.local/lib/python3.6/site-packages/detectron2/engine/train_loop.py", line 140, in train self.run_step() File "/home/user1/.local/lib/python3.6/site-packages/detectron2/engine/train_loop.py", line 220, in run_step data = next(self._data_loader_iter) File "/home/user1/.local/lib/python3.6/site-packages/detectron2/data/common.py", line 142, in iter for d in self.dataset: File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 363, in next data = self._next_data() File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 989, in _next_data return self._process_data(data) File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1014, in _process_data data.reraise() File "/home/user1/.local/lib/python3.6/site-packages/torch/_utils.py", line 395, in reraise raise self.exc_type(msg) NotImplementedError: Caught NotImplementedError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 185, in _worker_loop data = fetcher.fetch(index) File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/user1/.local/lib/python3.6/site-packages/detectron2/data/common.py", line 41, in getitem data = self._map_func(self._dataset[cur_idx]) File "/home/user1/.local/lib/python3.6/site-packages/detectron2/utils/serialize.py", line 23, in call return self._obj(*args, **kwargs) File "/home/user1/.local/lib/python3.6/site-packages/detectron2/data/dataset_mapper.py", line 183, in call instances.gt_boxes = instances.gt_masks.get_bounding_boxes() File "/home/user1/.local/lib/python3.6/site-packages/detectron2/structures/masks.py", line 204, in get_bounding_boxes raise NotImplementedError NotImplementedError

[10/26 18:26:00 d2.engine.hooks]: Total training time: 0:00:00 (0:00:00 on hooks)

NotImplementedError Traceback (most recent call last) <ipython-input-25-02eb9086db00> in <module> 18 trainer = DefaultTrainer(cfg) 19 trainer.resume_or_load(resume=False) ---> 20 trainer.train()

~/.local/lib/python3.6/site-packages/detectron2/engine/defaults.py in train(self) 397 OrderedDict of results, if evaluation is enabled. Otherwise None. 398 """ --> 399 super().train(self.start_iter, self.max_iter) 400 if len(self.cfg.TEST.EXPECTED_RESULTS) and comm.is_main_process(): 401 assert hasattr(

~/.local/lib/python3.6/site-packages/detectron2/engine/train_loop.py in train(self, start_iter, max_iter) 138 for self.iter in range(start_iter, max_iter): 139 self.before_step() --> 140 self.run_step() 141 self.after_step() 142 except Exception:

~/.local/lib/python3.6/site-packages/detectron2/engine/train_loop.py in run_step(self) 218 If you want to do something with the data, you can wrap the dataloader. 219 """ --> 220 data = next(self._data_loader_iter) 221 data_time = time.perf_counter() - start 222

~/.local/lib/python3.6/site-packages/detectron2/data/common.py in iter(self) 140 141 def iter(self): --> 142 for d in self.dataset: 143 w, h = d["width"], d["height"] 144 bucket_id = 0 if w > h else 1

~/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py in next(self) 361 362 def next(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \

~/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py in _next_data(self) 987 else: 988 del self._task_info[idx] --> 989 return self._process_data(data) 990 991 def _try_put_index(self):

~/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py in _process_data(self, data) 1012 self._try_put_index() 1013 if isinstance(data, ExceptionWrapper): -> 1014 data.reraise() 1015 return data 1016

~/.local/lib/python3.6/site-packages/torch/_utils.py in reraise(self) 393 # (https://bugs.python.org/issue2651), so we work around it. 394 msg = KeyErrorMessage(msg) --> 395 raise self.exc_type(msg)

NotImplementedError: Caught NotImplementedError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 185, in _worker_loop data = fetcher.fetch(index) File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/user1/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/user1/.local/lib/python3.6/site-packages/detectron2/data/common.py", line 41, in getitem data = self._map_func(self._dataset[cur_idx]) File "/home/user1/.local/lib/python3.6/site-packages/detectron2/utils/serialize.py", line 23, in call return self._obj(*args, **kwargs) File "/home/user1/.local/lib/python3.6/site-packages/detectron2/data/dataset_mapper.py", line 183, in call instances.gt_boxes = instances.gt_masks.get_bounding_boxes() File "/home/user1/.local/lib/python3.6/site-packages/detectron2/structures/masks.py", line 204, in get_bounding_boxes raise NotImplementedError NotImplementedError

closed time in 4 days

PurveshChhajed

issue closedfacebookresearch/detectron2

Cross Validation with Detectron2

Hello and congratulations on the work done on Detectron2,

I would like to ask you, whether it is possible to perform cross validation with detectron2.

e.g.: to pass as input a dataset in the format that accepts it and to perform lets say a k-fold with k=5 or another value.

If the above it cannot be yet performed, it is possible to build a custom function doing it? For example i have thought to split the dataset if k=5 to 5 different ones and then in a loop to run the expirement for 5 times changing the test set and using the remaining k-1 for training. After this i would keep the metrics.json and when completed afer having seen all the k-datasets i will average the metrics.

Thank you in advance!

closed time in 4 days

thanoscs

issue commentfacebookresearch/detectron2

Cross Validation with Detectron2

For example i have thought to split the dataset if k=5 to 5 different ones and then in a loop to run the expirement for 5 times changing the test set and using the remaining k-1 for training. After this i would keep the metrics.json and when completed afer having seen all the k-datasets i will average the metrics.

You can certainly implement such logic. We have no plan to add this to detectron2 though.

thanoscs

comment created time in 4 days

issue closedfacebookresearch/detectron2

inference custom model on video detectron2 on colab

I used this command to inference video using the code in demo.py:

!python demo/demo.py --config-file configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml --video-input ../video-clip.mp4 --confidence-threshold 0.6 --output ../video-output.mkv --opts MODEL.WEIGHTS /content/model_final.pth

Output video has no bounding boxes, either mask drawn. by the way,the custom trained model works well on some selected images. The input video was downloaded from YouTube (as per the demo). What could be the problem?

closed time in 4 days

FirasAbdennadher

issue commentfacebookresearch/detectron2

inference custom model on video detectron2 on colab

As the issue template mentions:

If you expect the model to converge / work better, note that we do not give suggestions on how to train a new model. Only in one of the two conditions we will help with it: (1) You're unable to reproduce the results in detectron2 model zoo. (2) It indicates a detectron2 bug.

We provide configs & models with standard academic settings and expect users to have the knowledge to choose or design appropriate models & parameters for their own tasks.

FirasAbdennadher

comment created time in 4 days

issue commentfacebookresearch/detectron2

Error using RandomRotation Transformation

I don't know what is "polygon superpixel level segmentation". Please try to explain the question using one of the issue templates.

nazerimahdi2001

comment created time in 4 days

issue commentfacebookresearch/detectron2

prediction mask

Unfortunately I'm not able to understand what you try to obtain. Please try describing your question in one of the issue template.

glcsvg

comment created time in 5 days

issue commentfacebookresearch/detectron2

Error using RandomRotation Transformation

If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

nazerimahdi2001

comment created time in 5 days

issue closedfacebookresearch/detectron2

ImportError: cannot import name 'dump_torchscript_IR'

Instructions To Reproduce the 🐛 Bug:

Open example notebook in Google Colab and try to import dump_torchscript_IR.

Output import_error

closed time in 5 days

TannerGilbert

issue commentfacebookresearch/detectron2

ImportError: cannot import name 'dump_torchscript_IR'

As expected because the notebook does not use the latest version of detectron2 from github. If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

TannerGilbert

comment created time in 5 days

issue commentfacebookresearch/detectron2

How to train and debug PointRend? We add configs of PointRend but the program doesn't seem to be working.

If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

GuoRuohao

comment created time in 6 days

issue closedfacebookresearch/detectron2

Incorrect results from pairwise_iou_rotated

Instructions To Reproduce the 🐛 Bug:

  1. what code you wrote
from detectron2.structures import BoxMode, RotatedBoxes, pairwise_iou_rotated
import torch
dt1 = RotatedBoxes(torch.tensor([[296.6620178222656, 458.73883056640625, 23.515729904174805, 47.677001953125, 0.08795166015625]]))
gt1 = RotatedBoxes(torch.tensor([[296.66201, 458.73882000000003, 23.51573, 47.67702, 0.087951]]))
iou1 = pairwise_iou_rotated(dt1, gt1)
print("iou1: %f" % iou1)

dt2 = RotatedBoxes(torch.tensor([[296.6620178222656, 458.73883056640625, 23.515729904174805, 47.677001953125, 0.08795166015625]]))
gt2 = RotatedBoxes(torch.tensor([[296.66201, 458.73882000000003, 23.51573, 47.6770, 0.087951]]))
iou2 = pairwise_iou_rotated(dt2, gt2)
print("iou2: %f" % iou2)
  1. what you observed (including full logs):
iou1: 0.600224
iou2: 1.000000

Expected behavior:

Both iou1 and iou2 should be 1.

Environment:

Provide your environment information using the following command:

----------------------  ----------------------------------------------------------------------
sys.platform            linux
Python                  3.7.9 (default, Aug 31 2020, 12:42:55) [GCC 7.3.0]
numpy                   1.19.1
detectron2              0.2.1 @/home/qiank10/Project/detectron2/detectron2
Compiler                GCC 7.4
CUDA compiler           CUDA 10.2
detectron2 arch flags   7.5
DETECTRON2_ENV_MODULE   <not set>
PyTorch                 1.4.0 @/home/qiank10/anaconda3/lib/python3.7/site-packages/torch
PyTorch debug build     False
GPU available           True
GPU 0,1,2,3             GeForce RTX 2080 Ti (arch=7.5)
CUDA_HOME               /usr/local/cuda-10.2
Pillow                  7.2.0
torchvision             0.5.0 @/home/qiank10/anaconda3/lib/python3.7/site-packages/torchvision
torchvision arch flags  3.5, 5.0, 6.0, 7.0, 7.5
fvcore                  0.1.2.post20201016
cv2                     4.2.0
----------------------  ----------------------------------------------------------------------
PyTorch built with:
  - GCC 7.3
  - Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v0.21.1 (Git Hash 7d2fd500bc78936d1d648ca713b901012f470dbc)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CUDA Runtime 10.1
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - CuDNN 7.6.3
  - Magma 2.5.1
  - Build settings: BLAS=MKL, BUILD_NAMEDTENSOR=OFF, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Wno-stringop-overflow, DISABLE_NUMA=1, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF, 

closed time in 6 days

qiank10

issue commentfacebookresearch/detectron2

Incorrect results from pairwise_iou_rotated

fixed by https://github.com/facebookresearch/detectron2/pull/2178

qiank10

comment created time in 6 days

issue commentfacebookresearch/detectron2

How to train and debug PointRend? We add configs of PointRend but the program doesn't seem to be working.

If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

GuoRuohao

comment created time in 6 days

issue commentfacebookresearch/detectron2

PanopticSeg -predmask

Unfortunately I'm not able to understand what you try to obtain. Please try describing your question in one of the issue template.

glcsvg

comment created time in 6 days

issue closedfacebookresearch/detectron2

Sample script needs to be updated.

https://github.com/facebookresearch/detectron2/blob/d35c3c36dcee1b01faf46144625193f8979996d2/tools/plain_train_net.py#L159

The above line needs to be updated since it currently fails. The fix should be storage.step().

closed time in 6 days

rdesc

issue commentfacebookresearch/detectron2

Sample script needs to be updated.

It does not fail with the github master version of detectron2. You can also use an old version of plain_train_net.py if you're using older version of detectron2.

rdesc

comment created time in 6 days

create barnchppwwyyxx/detectron2

branch : export-D23428853

created branch time in 7 days

PR opened facebookresearch/detectron2

drop PyTorch1.4 support

Summary: Pull Request resolved: https://github.com/fairinternal/detectron2/pull/454

Differential Revision: D23428853

Pulled By: ppwwyyxx

+12 -143

0 comment

9 changed files

pr created time in 7 days

issue closedfacebookresearch/detectron2

AttributeError: Cannot find field 'pred_masks' in the given Instances! :: Mask-RCNN

I am training and testing a mask-rcn model as below , but pred_mask is not there

I have trained as below

Screenshot 2020-10-23 173921

I have tested as Screenshot 2020-10-23 174008

Screenshot 2020-10-23 174039

Screenshot 2020-10-23 174100

@ppwwyyxx,
Please look into it

closed time in 7 days

Randheerkumar

issue commentfacebookresearch/detectron2

AttributeError: Cannot find field 'pred_masks' in the given Instances! :: Mask-RCNN

I have tested as

The config that's used in training should be used in testing.

Randheerkumar

comment created time in 7 days

issue closedfacebookresearch/detectron2

NotImplementedError in training for instance segmentation

❓Not able to train due to "NotImplementedError"

Getting following error during training instances.gt_boxes = instances.gt_masks.get_bounding_boxes() File "/usr/local/lib/python3.6/dist-packages/detectron2/structures/masks.py", line 204, in get_bounding_boxes raise NotImplementedError NotImplementedError

I am training on v5 dataset and using cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv.yaml .

I have converted mask (binary image ) into dict using pycocotools.mask.encode(np.asarray(mask, order="F")) Is error coming due to this conversion

closed time in 7 days

Randheerkumar

issue commentfacebookresearch/detectron2

NotImplementedError in training for instance segmentation

detectron2/structures/masks.py", line 204, in get_bounding_boxes raise NotImplementedError

This is implemented in github master version of the project.

If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

Randheerkumar

comment created time in 7 days

issue closedfacebookresearch/detectron2

not able to the retrain model from previous checkpoint

hi , i am trying to retrain the detectron instance segmentation model (using mask rcnn -50 layer )from previous checkpoint by giving resume=True in the cfg inputs . but it always starts from 0th iteration .

can one suggest how to fix this .

thanks

closed time in 7 days

karankatiyar92

issue closedfacebookresearch/detectron2

onnx support for embedded gpu devices

🚀 Feature

.onnx format export for embedded use cases like NVIDIA jetson boards with GPU support. For real-time applications

Motivation & Examples

I have been working with embedded ai projects for 3 months. I tried several training and inferring frameworks and I believe that detectron2 is one of the bests among them. Embedded use of ai is a hot topic. It would nice to use detectron2 for all pre-inference tasks configuring, training etc. and export the final model to .onnx with gpu support. Then use this model for inference on embedded devices that has GPU in it.


export_to_onnx("<name_of_the_torch_model>.pth","<path/to/your/onnx>")

Note

We only consider adding new features if they are relevant to many users.

If you request implementation of research papers -- we only consider papers that have enough significance and prevalance in the object detection field.

We do not take requests for most projects in the projects/ directory, because they are research code release that is mainly for other researchers to reproduce results.

"Make X faster/accurate" is not a valid feature request. "Implement a concrete feature that can make X faster/accurate" can be a valid feature request.

Instead of adding features inside detectron2, you can implement many features by extending detectron2. The projects/ directory contains many of such examples.

closed time in 7 days

berkantay

issue commentfacebookresearch/detectron2

onnx support for embedded gpu devices

export_to_onnx("<name_of_the_torch_model>.pth","<path/to/your/onnx>")

This API is impossible because the pth file does not contain model structure.

Please find how to do onnx conversion in existing issue.

berkantay

comment created time in 7 days

issue commentfacebookresearch/detectron2

How to get and visualize the mask of a single class from pre-trained model?

https://detectron2.readthedocs.io/modules/structures.html#detectron2.structures.Instances answers:

Indexing: instances[indices] will apply the indexing on all the fields and returns a new Instances. Typically, indices is a integer vector of indices, or a binary mask of length num_instances category_3_detections = instances[instances.pred_classes == 3] confident_detections = instances[instances.scores > 0.9]

farazk86

comment created time in 7 days

issue commentpytorch/pytorch

with torch.cuda.amp.autocast() get out of memory error when using with torch.no_grad() during validation

Existing docs are pretty clear context manager usage should be per-forward-pass

I think the existing doc only says it should be used on forward passes but not "per-forward-pass". The doc uses training as an example and there the two concepts are equivalent. But for inference it can be confusing.

nhsjgczryf

comment created time in 7 days

issue closedfacebookresearch/detectron2

How to Generate ScriptModule with torch.jit.trace for MaskRcnn

❓ How to Generate ScriptModule with torch.jit.trace for MaskRcnn

I want to deploy the Models trained by Detectron2 with TVM, and the first step is using torch.jit.trace to create the ScriptModule.

The script I use

import torch
from detectron2.config import get_cfg
from detectron2 import model_zoo

class TraceWrapper(torch.nn.Module):
    def __init__(self, model, height, width):
        super().__init__()
        self.model = model
        self.height = height
        self.width = width

    def forward(self, inp):
        inputs = {"image": inp, "height": self.height, "width": self.width}
        #out = self.model(inp)
        predictions = self.model([inputs])[0]
        instances = predictions['instances']
        return instances.pred_classes, instances.pred_boxes.tensor, instances.scores

def get_test_image(cfg):
    original_image = cv2.imread("data/000000439715.jpg")
    aug = T.ResizeShortestEdge(
        [cfg.INPUT.MIN_SIZE_TEST, cfg.INPUT.MIN_SIZE_TEST], cfg.INPUT.MAX_SIZE_TEST
    )
    height, width = original_image.shape[:2]
    image = aug.get_transform(original_image).apply_image(original_image)
    image = image.astype("float32").transpose(2, 0, 1)
    return image, height, width

def main():
    cfg = get_cfg()
    cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml"))
    cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5
    cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
    
    predictor = DefaultPredictor(cfg)

    org_image, height, width = get_test_image(cfg)
    image = torch.as_tensor(org_image)


    trace_wrapper_model = TraceWrapper(predictor.model, height, width)
    trace_wrapper_model.eval()

    with torch.no_grad():
        model_trace = torch.jit.trace(trace_wrapper_model, image)
        model_trace.eval()


if __name__ == '__main__':
    main()

The error I get

Traceback (most recent call last):
  File "mask_rcnn_lab.py", line 92, in <module>
    det_lab()
  File "mask_rcnn_lab.py", line 79, in det_lab
    model_trace = torch.jit.trace(trace_wrapper_model, image)
  File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/__init__.py", line 955, in trace
    check_tolerance, strict, _force_outplace, _module_class)
  File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/__init__.py", line 1119, in trace_module
    check_tolerance, strict, _force_outplace, True, _module_class)
  File "/root/anaconda3/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context
    return func(*args, **kwargs)
  File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/__init__.py", line 736, in _check_trace
    if compare_outputs(traced_outs, fn_outs, 'Python function'):
  File "/root/anaconda3/lib/python3.7/site-packages/torch/jit/__init__.py", line 724, in compare_outputs
    atol=torch.testing._get_default_tolerance(orig, ref)[1])
  File "/root/anaconda3/lib/python3.7/site-packages/torch/testing/__init__.py", line 207, in assert_allclose
    expected = expected.expand_as(actual)
RuntimeError: The expanded size of the tensor (0) must match the existing size (15) at non-singleton dimension 0.  Target sizes: [0].  Tensor sizes: [15]

closed time in 7 days

lsy643

issue commentfacebookresearch/detectron2

How to Generate ScriptModule with torch.jit.trace for MaskRcnn

Tracing is not yet an officially supported feature. However it can work correctly if you:

  • use github master of detectron2
  • use github master of pytorch
  • call jit.trace under this context: https://github.com/facebookresearch/detectron2/blob/d35c3c36dcee1b01faf46144625193f8979996d2/detectron2/export/torchscript_patch.py#L182-L184

Or use the caffe2 tracer described in https://detectron2.readthedocs.io/tutorials/deployment.html - in that case the resulting graph will contain many ops not yet supported by tvm or any other runtime that's not caffe2.

lsy643

comment created time in 7 days

pull request commentfacebookresearch/detectron2

Improve ONNX tracing support for Faster-RCNN

FYI we also hide the changes to len() under a patch function. In general we avoid hacks on modeling code if the same effect can be achieved by more hacks outside the modeling code.

crisp-snakey

comment created time in 8 days

issue closedfacebookresearch/detectron2

Default process group is not initialized

Instructions To Reproduce the 🐛 Bug:

  1. Call any training code with num_gpus = 1, and num_machines=1. Gives the following error:
Traceback (most recent call last):
  File "train_net.py", line 172, in <module>
    args=(args,),
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/detectron2/engine/launch.py", line 62, in launch
    main_func(*args)
  File "train_net.py", line 160, in main
    return trainer.train()
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/detectron2/engine/defaults.py", line 410, in train
    super().train(self.start_iter, self.max_iter)
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/detectron2/engine/train_loop.py", line 142, in train
    self.run_step()
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/detectron2/engine/train_loop.py", line 235, in run_step
    loss_dict = self.model(data)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/projects/Panoptic-DeepLab/panoptic_deeplab/panoptic_seg.py", line 87, in forward
    features = self.backbone(images.tensor)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/detectron2/modeling/backbone/resnet.py", line 432, in forward
    x = self.stem(x)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/projects/DeepLab/deeplab/resnet.py", line 59, in forward
    x = self.conv1(x)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/BS/ahmed_projects/work/projects/conseg/depends/detectron2/detectron2/layers/wrappers.py", line 106, in forward
    x = self.norm(x)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 493, in forward
    world_size = torch.distributed.get_world_size(process_group)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 620, in get_world_size
    return _get_group_size(group)
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 219, in _get_group_size
    _check_default_pg()
  File "/home/ahabbas/software/anaconda3/envs/conseg/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 210, in _check_default_pg
    "Default process group is not initialized"
AssertionError: Default process group is not initialized

Possible fix:

The error goes away when I change >1 to >=1 at: https://github.com/facebookresearch/detectron2/blob/200c66e7a9ece92e6fb7f78856b9fd3ca5eb1925/detectron2/engine/launch.py#L41

closed time in 8 days

aabbas90

issue commentfacebookresearch/detectron2

Default process group is not initialized

SyncBatchNorm cannot run on 1 GPU by its definition.

If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.

aabbas90

comment created time in 8 days

issue closedfacebookresearch/detectron2

How do i select certain classes?

❓ How to do something using detectron2

how can i filter de predictions after the predictions and before he writes it?, i want the code to only print the "pred_classes==0", it can detect all classes, but i only want to visual see the some classes, is there anyway to do it?

closed time in 8 days

Eloi-14855

issue commentfacebookresearch/detectron2

How do i select certain classes?

Duplicate of #1746

Eloi-14855

comment created time in 8 days

issue closedfacebookresearch/detectron2

Interpolation type of segmentation masks

🚀 Feature

Currently the segmentation results are being interpolated through bi-linear interpolation. I think, for integer valued matrices where there is no meaning in between two labels (e.g. cat(label = 1), dog(label=2)), interpolating these two values is not the right way. The segmentation results should be interpolated by nearest neighbors and can possibly improve accuracy of segmentation type images slightly.

Code location

https://github.com/facebookresearch/detectron2/blob/200c66e7a9ece92e6fb7f78856b9fd3ca5eb1925/detectron2/modeling/postprocessing.py#L96

Change mode="bilinear" to mode="nearest".

This function is used at many places, e.g.: https://github.com/facebookresearch/detectron2/blob/200c66e7a9ece92e6fb7f78856b9fd3ca5eb1925/detectron2/modeling/meta_arch/semantic_seg.py#L90

closed time in 8 days

aabbas90

issue commentfacebookresearch/detectron2

Interpolation type of segmentation masks

for integer valued matrices where there is no meaning in between two labels

This is correct, but we are not interpolating integer-valued matrices. If you found otherwise, please file a bug report.

aabbas90

comment created time in 8 days

push eventppwwyyxx/detectron2

Yuxin Wu

commit sha 568aee255804a38ab31d594da338bf0578a07221

make StandardROIHeads scriptable Summary: add type annotation and jit bypassing Reviewed By: theschnitz Differential Revision: D24479552 fbshipit-source-id: cbb5076821da39f57cb4bee138528c1c72723a8b

view details

push time in 8 days

issue closedfacebookresearch/detectron2

loss_box_reg values are always zero in training object detection-fatser rcnn

If you do not know the root cause of the problem, and wish someone to help you, please post according to this template:

Instructions To Reproduce the Issue:

Check https://stackoverflow.com/help/minimal-reproducible-example for how to ask good questions. Simplify the steps to reproduce the issue using suggestions from the above link, and provide them below:

1. full code you wrote or full changes you made (git diff)

My dataset is of COCO format, but is a custom dataset that i created using the following code:

def get_details(data, _values, Anno):
'
  dataset_ = [] # Main list[dict] having details of all the files in training
  anns = []

  for img_num in range(len(data)):

    file_details = {} # dict --> has details of the image 
    ANNO = [] # list[dict] --> each dict corresponds to an instance(bbox) in the image

    img_file = data[img_num] 
    #print(img_file, type(img_file))
    file_loc = imgloc + img_file # Location of the required image
    #print('File Location: ', file_loc)

    index = _values[img_num] 
    #print(index)
    #print(newdf.loc[newdf['Image Name'] == img_file, ['Annotations']])
    #print((newdf[newdf['Image Name'] == img_file].index[0]))
    assert (newdf[newdf['Image Name'] == img_file].index[0]) == index, "Index mismatch"

    #print('Anno: ', Anno[index])
    a = Anno[index]
    if(a == 'Not Damaged'):
      #print('Not Damaged!')
      ANNO = []

    else:

      a = a[2:-2]
      #print('a after removing: ', a)
      anno = a.split('], [')
      #print(anno)
      #print('Number of bbox: ', len(anno))

      #Runs through every bbox
      for an in anno:
        #print('an: ', an)
        coordinates = an.split(', ')
        #print(coordinates, len(coordinates))
        
        if(img_file[5] == '3'):
          xmin = int(int(coordinates[0])*216/432)
          ymin = int(int(coordinates[1])*288/576)
          xmax = int(int(coordinates[2])*216/432)
          ymax = int(int(coordinates[3])*288/576)
        else:
          xmin = int(int(coordinates[0])*288/576)
          ymin = int(int(coordinates[1])*216/432)
          xmax = int(int(coordinates[2])*288/576)
          ymax = int(int(coordinates[3])*216/432)

        anno_dict = {'bbox': [xmin, ymin, xmax, ymax],
                    'bbox_mode': BoxMode.XYXY_ABS,
                    'category_id': 1}
        
        ANNO.append(anno_dict)
    #print(ANNO)

    anns.append(file_loc[-8:-4])
    file_details['file_name'] = file_loc
    file_details['image_id'] = file_loc[-8:-4]
    file_details['height'] = 216
    file_details['width'] = 288
    file_details['annotations'] = ANNO 

    dataset_.append(file_details)
    #print('An image has been added!')
  
  
    
  return dataset_

To register data

dataset_ = []
for sets in range(2):
  dataset_name = 'CherrycropS/' + str(sets)
  if (sets == 0):
    DatasetCatalog.register(dataset_name, lambda dataset_ = dataset_: getd(sets, training, tr_values, Anno, validation, val_values))
    MetadataCatalog.get(dataset_name).set(thing_classes=['Damaged'])
  elif (sets == 1):
    DatasetCatalog.register(dataset_name, lambda dataset_ = dataset_: getd(sets, training, tr_values, Anno, validation, val_values))
    MetadataCatalog.get(dataset_name).set(thing_classes=['Damaged'])
    

crop_metadata = MetadataCatalog.get("CherrycropS/0")

Custom data loader

from detectron2.engine import DefaultTrainer
from detectron2.evaluation import COCOEvaluator

class CocoTrainer(DefaultTrainer):

  @classmethod
  def build_evaluator(cls, cfg, dataset_name, output_folder=None):

    if output_folder is None:
        os.makedirs("coco_eval", exist_ok=True)
        output_folder = "coco_eval"

    return COCOEvaluator(dataset_name, cfg, False, `output_folder)

Training

from detectron2.engine import DefaultTrainer
from detectron2.config import get_cfg

cfg = get_cfg()
cfg.merge_from_file(model_zoo.get_config_file("COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml"))
cfg.DATASETS.TRAIN = ("CherrycropS/0",)
cfg.DATASETS.TEST = ()
cfg.DATALOADER.NUM_WORKERS = 4
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml")  # Let training initialize from model zoo
cfg.SOLVER.IMS_PER_BATCH = 10
cfg.SOLVER.BASE_LR = 0.0125  # pick a good LR
cfg.SOLVER.MAX_ITER = 100    # 300 iterations seems good enough for this toy dataset; you may need to train longer for a practical dataset
cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 128   # faster, and good enough for this toy dataset (default: 512)
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1  # only has one class (damaged region)

os.makedirs(cfg.OUTPUT_DIR, exist_ok=True)
trainer = CocoTrainer(cfg) 
trainer.resume_or_load(resume=False)
trainer.train()
  1. what exact command you run: I ran all these in separate cells on Google Colab
  2. full logs you observed:
[10/15 20:55:29 d2.data.build]: Removed 81 images with no usable annotations. 151 images left.
[10/15 20:55:29 d2.data.build]: Distribution of instances among all 1 categories:
|  category  | #instances   |
|:----------:|:-------------|
|  Damaged   | 648          |
|            |              |
[10/15 20:55:29 d2.data.common]: Serializing 151 elements to byte tensors and concatenating them all ...
[10/15 20:55:29 d2.data.common]: Serialized dataset takes 0.05 MiB
[10/15 20:55:29 d2.data.dataset_mapper]: Augmentations used in training: [ResizeShortestEdge(short_edge_length=(640, 672, 704, 736, 768, 800), max_size=1333, sample_style='choice'), RandomFlip()]
[10/15 20:55:29 d2.data.build]: Using training sampler TrainingSampler
Skip loading parameter 'roi_heads.box_predictor.cls_score.weight' to the model due to incompatible shapes: (81, 1024) in the checkpoint but (2, 1024) in the model! You might want to double check if this is expected.
Skip loading parameter 'roi_heads.box_predictor.cls_score.bias' to the model due to incompatible shapes: (81,) in the checkpoint but (2,) in the model! You might want to double check if this is expected.
Skip loading parameter 'roi_heads.box_predictor.bbox_pred.weight' to the model due to incompatible shapes: (320, 1024) in the checkpoint but (4, 1024) in the model! You might want to double check if this is expected.
Skip loading parameter 'roi_heads.box_predictor.bbox_pred.bias' to the model due to incompatible shapes: (320,) in the checkpoint but (4,) in the model! You might want to double check if this is expected.
[10/15 20:55:30 d2.engine.train_loop]: Starting training from iteration 0
[10/15 20:55:54 d2.utils.events]:  eta: 0:01:36  iter: 19  total_loss: 0.832  loss_cls: 0.387  loss_box_reg: 0.000  loss_rpn_cls: 0.278  loss_rpn_loc: 0.086  time: 1.1773  data_time: 0.0919  lr: 0.000250  max_mem: 9528M
[10/15 20:56:17 d2.utils.events]:  eta: 0:01:12  iter: 39  total_loss: 0.130  loss_cls: 0.002  loss_box_reg: 0.000  loss_rpn_cls: 0.048  loss_rpn_loc: 0.082  time: 1.1719  data_time: 0.0731  lr: 0.000500  max_mem: 9528M
[10/15 20:56:40 d2.utils.events]:  eta: 0:00:49  iter: 59  total_loss: 0.095  loss_cls: 0.000  loss_box_reg: 0.000  loss_rpn_cls: 0.030  loss_rpn_loc: 0.056  time: 1.1733  data_time: 0.0743  lr: 0.000749  max_mem: 9528M
[10/15 20:57:04 d2.utils.events]:  eta: 0:00:25  iter: 79  total_loss: 0.072  loss_cls: 0.000  loss_box_reg: 0.000  loss_rpn_cls: 0.018  loss_rpn_loc: 0.053  time: 1.1736  data_time: 0.0750  lr: 0.000999  max_mem: 9528M
[10/15 20:57:29 d2.utils.events]:  eta: 0:00:01  iter: 99  total_loss: 0.071  loss_cls: 0.000  loss_box_reg: 0.000  loss_rpn_cls: 0.015  loss_rpn_loc: 0.057  time: 1.1718  data_time: 0.0731  lr: 0.001249  max_mem: 9528M
[10/15 20:57:29 d2.engine.hooks]: Overall training speed: 97 iterations in 0:01:54 (1.1839 s / it)
[10/15 20:57:29 d2.engine.hooks]: Total training time: 0:01:56 (0:00:01 on hooks)

Expected behavior:

I thought that this code should provide some loss_box_reg value as in several examples online. However, I haven't been able to understand why this doesn't produce any value in the parameter loss_box_reg. Please do help me udnerstadn why this behaviour is observed.

Environment:

I'm working on Google Colab with GPU runtime.

closed time in 8 days

SuzaKrish

issue commentfacebookresearch/detectron2

loss_box_reg values are always zero in training object detection-fatser rcnn

0 is also a value, and any number close enough to 0 might be printed as 0.

This doesn't look like an unexpected issue - unless there is a reason to prove that the value should not be close to 0.

SuzaKrish

comment created time in 8 days

issue commentfacebookresearch/detectron2

How to fix the mask with fixed color instead of random color

Unfortunately I could not understand what you attempt to do. Please provide information according to the issue template.

xiaoxierui

comment created time in 8 days

PR opened facebookresearch/detectron2

make StandardROIHeads scriptable

Summary: add type annotation and jit bypassing

Reviewed By: theschnitz

Differential Revision: D24479552

+116 -25

0 comment

5 changed files

pr created time in 8 days

create barnchppwwyyxx/detectron2

branch : export-D24479552

created branch time in 8 days

issue closedfacebookresearch/detectron2

Assertion error detectron2/data/transforms/transform.py", line 130

I am getting an assertion error. I am training COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml. The error is following:

File "/usr/local/lib/python3.6/dist-packages/fvcore/transforms/transform.py", line 290, in _apply x = getattr(t, meth)(x) File "/usr/local/lib/python3.6/dist-packages/detectron2/data/transforms/transform.py", line 130, in apply_segmentation segmentation = self.apply_image(segmentation, interp=Image.NEAREST) File "/usr/local/lib/python3.6/dist-packages/detectron2/data/transforms/transform.py", line 102, in apply_image assert img.shape[:2] == (self.h, self.w) AssertionError

Please help me

closed time in 8 days

Randheerkumar

issue commentfacebookresearch/detectron2

Assertion error detectron2/data/transforms/transform.py", line 130

It suggests your segmentation annotation and image have different sizes. Please double check your data. If you need help investigating an issue, please include details following the "Unexpected behaviors" issue template.

Randheerkumar

comment created time in 8 days

pull request commentpytorch/pytorch

[JIT] Enable ModuleDict non-literal indexing

It's not ideal but what about using Any return type?

Thanks! That works well! We don't always get to change the return type (e.g. if the module is defined in pytorch) but wrapping the module as @eellison suggests can solve that. We now can script our backbone (D24473591)

SplitInfinity

comment created time in 8 days

Pull request review commentpytorch/pytorch

[JIT] Metacompile boolean constants

 struct to_ir {         if (expr_out->node()->kind() == aten::is_scripting) {           static_if = true;         }+        // MetaCompile on boolean literals and constants

line169 has some comment that appears related and confusing:

  c10::optional<bool>
      static_if_; // certain expression cause us to emit a static if statement
                  // this value is present if this is the case.
                  // this is not equivalent to value_ being a constant
                  // it is possible for value_ to be constant but for
                  // the expression that produced it to not trigger the
                  // static if behavior. e.g. use of a variable assigned
                  // to a constant

I don't know if they need to be updated to reflect this PR

eellison

comment created time in 8 days

PullRequestReviewEvent

issue closedfacebookresearch/detectron2

Two rotated boxes are nearly identical to very high precision, but do not yield an iou of 1.0

Two rotated boxes are nearly identical to very high precision, but do not yield an IoU of 1.0 This is probably some strange edge case in the calculation. How do I come upon this? Some of my data has been partially labelled by a model and the rotated COCO evaluation is giving me unstable results if I submit boxes that are again created with the same model.

Instructions To Reproduce the 🐛 Bug:

Python 3.7.9 (default, Aug 31 2020, 12:42:55) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> from detectron2.layers.rotated_boxes import pairwise_iou_rotated
>>> pairwise_iou_rotated(torch.tensor([[2563.74462890625000000000, 1436.79016113281250000000, 2174.70336914062500000000,  214.09500122070312500000, 115.11834716796875000000]]), torch.tensor([[2563.74462890625000000000, 1436.79028320312500000000, 2174.70288085937500000000,  214.09495544433593750000, 115.11835479736328125000]]))
tensor([[0.5848]])

Expected behaviour:

tensor([[1.0000]])

Environment:

wget -nc -q https://github.com/facebookresearch/detectron2/raw/master/detectron2/utils/collect_env.py && python collect_env.py
----------------------  --------------------------------------------------------------------------------
sys.platform            linux
Python                  3.7.9 (default, Aug 31 2020, 12:42:55) [GCC 7.3.0]
numpy                   1.19.1
detectron2              0.2.1 @/host_home/code/detectron2/detectron2
Compiler                GCC 7.5
CUDA compiler           CUDA 10.1
detectron2 arch flags   7.0
DETECTRON2_ENV_MODULE   <not set>
PyTorch                 1.6.0 @/home/user/.conda/envs/detectron2/lib/python3.7/site-packages/torch
PyTorch debug build     False
GPU available           True
GPU 0                   Quadro GV100 (arch=7.0)
GPU 1                   GeForce RTX 2080 Ti (arch=7.5)
CUDA_HOME               /usr/local/cuda
Pillow                  7.1.2
torchvision             0.7.0 @/home/user/.conda/envs/detectron2/lib/python3.7/site-packages/torchvision
torchvision arch flags  3.5, 5.0, 6.0, 7.0, 7.5
fvcore                  0.1.2.post20201020
cv2                     4.2.0
----------------------  --------------------------------------------------------------------------------
PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.5.0 (Git Hash e2ac1fac44c5078ca927cb9b90e1b3066a0b2ed0)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 10.1
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - CuDNN 7.6.3
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF, 

closed time in 8 days

alekseynp

issue openedpytorch/pytorch

[jit] metacompile if-statements with boolean literal or boolean constants

🚀 Feature

Motivation

Skipping compilation when not needed is in general helpful more migrating code to torchscript.

Pitch

import torch

class A(torch.nn.Module):
    good: torch.jit.Final[bool]
    def __init__(self):
        super().__init__()
        self.good = True
    def forward(self, x):
        #if hasattr(self, 'good'):  # works
        #if True:  # fails
        #if self.good is not None:  # works
        if self.good:  # fails
            return x

        # imagine below are some code that are scriptable depend on the availability of self.good
        print("hello") + 2  # shall not be compiled

x = A()
f = torch.jit.script(x)
f.forward(torch.randn(3))

created time in 8 days

Pull request review commentpytorch/pytorch

[JIT] Enable ModuleDict non-literal indexing

 std::shared_ptr<SugaredValue> PythonModuleValue::attr(   return toSugaredValue(member, m, loc, /*is_constant=*/true); } +ModuleValue::ModuleValue(+    Value* self,+    std::shared_ptr<ConcreteModuleType> concreteType)+    : self_(self), concreteType_(std::move(concreteType)) {+  auto containedTypeHint = concreteType_->getContainedTypeHint();++  if (containedTypeHint) {+    // For now, only dict type containedTypeHints are supported. Generate and+    // emit the dictionary representing the ModuleDict into the graph once so+    // that it can be reused across lookups.+    DictTypePtr dict_type = containedTypeHint->expect<DictType>();+    auto* graph = self_->owningGraph();+    std::vector<Value*> keys, values;++    // Gather submodule names.+    std::vector<std::string> submodule_names;+    const auto& self_type = concreteType_->getJitType()->expect<ClassType>();+    for (size_t i = 0; i < self_type->numAttributes(); ++i) {+      const auto& attr_type = self_type->getAttribute(i);+      if (attr_type->is_module()) {+        if (!attr_type->isSubtypeOf(dict_type->getValueType())) {+          auto loc = self->node()->sourceRange();+          throw ErrorReport(loc)+              << "Attribute " << self_type->getAttributeName(i)+              << " is not of annotated type "+              << dict_type->getValueType()->annotation_str();

Would it be worthwhile to print more detailed reasons using the 2nd argument of isSubtypeOf? I don't actually know what's in the message but if it can tell me which method/argument does not match it would be very helpful.

SplitInfinity

comment created time in 8 days

PullRequestReviewEvent

Pull request review commentfacebookresearch/detectron2

Explain the mystery number num_categories.

 and the required fields vary based on what the dataloader or the task needs (see   + `bbox_mode` (int, required): the format of bbox.  It must be a member of     [structures.BoxMode](../modules/structures.html#detectron2.structures.BoxMode).     Currently supports: `BoxMode.XYXY_ABS`, `BoxMode.XYWH_ABS`.-  + `category_id` (int, required): an integer in the range [0, num_categories-1] representing the category label.+  + `category_id` (int, required): the category label, an integer in the range [0, num_categories-1] where+    num_categories is the number of distinct labels that will appear in the entire dataset.     The value num_categories is reserved to represent the "background" category, if applicable.+    That is, unless you are including annotations for the background, you must not skip labels.+    For example, if you use 3 as a label, your dataset must also use 0, 1, and 2 for labels elsewhere.+    If you use labels {0, 2, 3} then label 3 must only be used for the background.+    Using labels {0, 3, 4} is invalid.

I think these are not true - you can skip labels although that leads to waste of compute. Did you observe the opposite?

Jennifer-Rigdon

comment created time in 9 days

PullRequestReviewEvent

issue closedfacebookresearch/detectron2

How use pretrained weights from a pytorch/resnet50 backbone

Hello there and thanks for this great work on Detectron2 !

I am interested in object detection / segmentation using maskrcnn and the resnet50 backbone, which I use with msra pretrained weights.

Instead of using these weights I would like to use weights that I have in my possession and that come from a train with pytorch/torchvision with resnet50 .

Any idea how to do this? I have the feeling that the resnet backbones are not exactly the ones that are in torchvision, am I wrong ?

Thanks a lot for your ( I hope ) insights

closed time in 9 days

julien314

issue commentfacebookresearch/detectron2

How use pretrained weights from a pytorch/resnet50 backbone

See https://github.com/facebookresearch/detectron2/blob/master/MODEL_ZOO.md#imagenet-pretrained-models for the source of backbones and how to use torchvision backbones.

julien314

comment created time in 9 days

issue closedfacebookresearch/detectron2

Inference running more slowly than expected

I'm trying to run inference on a 101-layer TridentNet model. For some reason, it is slow, although it works. I have created a very stripped-down version of the problem here.

import torch,torchvision
import numpy as np
import logging
from time import time
from pathlib import Path
import detectron2
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config import get_cfg, configurable
from detectron2.engine import DefaultPredictor
from detectron2.modeling import build_model
from detectron2.utils.logger import setup_logger
from trident_project.dev_packages.TridentNet.tridentnet import add_tridentnet_config
setup_logger()

def setup_model_configuration(rootdir, output_dir, CLASS_NAMES):
    cfg = get_cfg()
    add_tridentnet_config(cfg) #Loads a few values that distinguish TridentNet from Detectron2
    
    cfg.MODEL.WEIGHTS = str(Path(rootdir)/"model_final.pth") 
    cfg.MODEL.MASK_ON = False
    cfg.MODEL.RESNETS.DEPTH = 101
    cfg.MODEL.ANCHOR_GENERATOR.SIZES = [[32, 64, 128, 256, 512]]
    cfg.MODEL.BACKBONE.FREEZE_AT = 1
    cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 512  #(default: 512)
    cfg.MODEL.ROI_HEADS.NUM_CLASSES = len(CLASS_NAMES) #
    cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.7  # set threshold for this model
    
    cfg.SOLVER.LR_SCHEDULER_NAME = "WarmupMultiStepLR"
    cfg.SOLVER.STEPS = (20000, 22000) #(210000, 250000) for trident, also 16K,18K for 20K
    cfg.SOLVER.MAX_ITER = 25000 #  270000 for trident
    cfg.SOLVER.WARMUP_ITERS = 1000 #1000 is default
    cfg.SOLVER.IMS_PER_BATCH = 4
    cfg.SOLVER.BASE_LR = 0.0005 
    cfg.SOLVER.CHECKPOINT_PERIOD = 5000
    
    cfg.INPUT.FORMAT = "BGR"
    cfg.MODEL.PIXEL_MEAN = [143.078, 140.690, 120.606] 
    cfg.MODEL.PIXEL_STD = [34.139, 29.849, 31.695]
        
    cfg.INPUT.MIN_SIZE_TRAIN = (400,420,440,460,480,500) 
    cfg.INPUT.MIN_SIZE_TEST = 500
    
    cfg.DATASETS.TRAIN = ("survey_train",) 
    cfg.DATASETS.TEST = ("test",)
    cfg.DATALOADER.NUM_WORKERS = 24 #Set to equal the number of CPUs.
    cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = False

    cfg.OUTPUT_DIR = output_dir
    cfg.MODEL.DEVICE='cuda' #'cuda' or 'cpu'
    cfg.freeze() 
    return cfg

#Create some fake images (Numpy arrays)
inputs = []
for i in range(10):
    image = np.random.randint(low=0, high=256, size=(500,500,3), dtype=np.uint8)
    inputs.append(image)

#Initialize the model
CLASS_NAMES = [
     'class1',
     'class2',
     'class3',
     'class4',
     'class5',
     'class6',
     'class7',
     'class8',
     'class9',
     'class10',
     'class11',
     'class12',
     'class13',
     'class14',
     'class15',
     'class16',
     'class17',
     'class18',
     'class19',
     'class20',
     'class21']

cfg = setup_model_configuration(rootdir, None, CLASS_NAMES)
model = DefaultPredictor(cfg)

# Run the model and time it
tic = time()
with torch.no_grad():
    for i in range(len(inputs)):
        outputs = model(inputs[i])
print("Inference on {} images done in {:.2f}s".format(len(inputs), (time() - tic)))

Result: 10 images (500x500 pixels each) took 36 seconds on an Azure NC6 machine using the CPU, i.e., 3.6 seconds per image. Using the GPU (Tesla K80), 10 images took 9.2 seconds, i.e., 0.92 seconds/image.

Alternative

Instead of using DefaultPredictor, I built the model and loaded the checkpoint, then created dicts in the Detectron2 format and passed them directly to the model. The results were identical (the speed is just as slow).

#Make some fake image dicts
inputs = []
for i in range(10):
    image_dict = {}
    image_dict['image_id'] = 'image_number_' + str(i)
    image_dict['image'] = torch.randint(low=0, high=256,size=(3,500,500), dtype=torch.uint8)
    image_dict['height'] = 500
    image_dict['width'] = 500
    inputs.append(image_dict)

# Initialize model
cfg = setup_model_configuration(rootdir, None, CLASS_NAMES)
model = build_model(cfg) 
DetectionCheckpointer(model).load(cfg.MODEL.WEIGHTS)

# Optional -- I tried this to test-run a single batch of 4 images on the GPU.  Same result.
inputs = inputs[:4] 

model.eval()
tic = time()
with torch.no_grad():
    outputs = model(inputs)
print("Inference on {} images done in {:.2f}s".format(len(inputs), (time() - tic)))

Result: 4 images took 3.8 seconds on the GPU.

wget -nc -q https://github.com/facebookresearch/detectron2/raw/master/detectron2/utils/collect_env.py && python collect_env.py
----------------------  ---------------------------------------------------------------------
sys.platform            linux
Python                  3.8.5 (default, Aug  5 2020, 08:36:46) [GCC 7.3.0]
numpy                   1.19.1
detectron2              0.2.1 @/anaconda/envs/trident/lib/python3.8/site-packages/detectron2
Compiler                GCC 7.3
CUDA compiler           CUDA 10.1
detectron2 arch flags   sm_35, sm_37, sm_50, sm_52, sm_60, sm_61, sm_70, sm_75
DETECTRON2_ENV_MODULE   <not set>
PyTorch                 1.5.0 @/anaconda/envs/trident/lib/python3.8/site-packages/torch
PyTorch debug build     False
GPU available           True
GPU 0,1,2,3             Tesla K80
CUDA_HOME               /usr/local/cuda
Pillow                  7.2.0
torchvision             0.6.0 @/anaconda/envs/trident/lib/python3.8/site-packages/torchvision
torchvision arch flags  sm_35, sm_50, sm_60, sm_70, sm_75
fvcore                  0.1.1.post20200716
cv2                     4.4.0
----------------------  ---------------------------------------------------------------------
PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v0.21.1 (Git Hash 7d2fd500bc78936d1d648ca713b901012f470dbc)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 10.2
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - CuDNN 7.6.5
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_INTERNAL_THREADPOOL_IMPL -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF,

closed time in 9 days

jcpayne

issue commentfacebookresearch/detectron2

Inference running more slowly than expected

Copy-pasted your code into colab: https://colab.research.google.com/drive/1DM1Bh7I7qeUvkEdntFRZmvjhjdV96lhd?usp=sharing It says every iteration is about 0.04s

jcpayne

comment created time in 9 days

push eventtensorpack/tensorpack

Yuxin Wu

commit sha 22f37f9aa646e48ce0066da985e29837be9b72cb

skip gradient packer for grads with undefined shape

view details

push time in 9 days

issue commenttensorpack/tensorpack

ResNext32x4d-101 not obtaining reported accuracy

I ran it again with -d 101 --mode resnext32x4d --weight-decay-norm and obtains 21.4%. This might better reflect its performance and the one in table might be a lucky run.

mgshmulik

comment created time in 9 days

more