vdigpku / cbnet_pytorch Goto Github PK
View Code? Open in Web Editor NEWCBNet implementation based on mmdetection (AAAI 2020)
License: Apache License 2.0
CBNet implementation based on mmdetection (AAAI 2020)
License: Apache License 2.0
请问会分享COCO上训练好的模型吗?
I am trying to use the old repo implementation, but I am having compatibility issues. This new repo could be an alternative. However, it seems that you don't provide instance segmentation config files. Why? Could you share them?
Thanks in advance
In the mmdet/models/backbones/, I find you didn't rewrite the freeze function.
The first contact with mmdetection, can you talk about how to train the network?
Would you mind sharing your pretrained model weights for us ?
CBNetv2与CBNet有什么区别,在论文中有介绍吗
Hi, have you tried to convert pth models to onnx models? When running pytorch2onnx.py, 'RuntimeError: ONNX export failed: Couldn't export Python operator _RoIAlignFunction ' happens.
I find a lot issue in mm2...
Thanks for your error report and we appreciate it a lot.
Checklist
Describe the bug
A clear and concise description of what the bug is.
Reproduction
CUDA_VISIBLE_DEVICES=0,2 PORT=29500 ./tools/dist_train.sh configs/cbnet/faster_rcnn_db_x101_32x4d_fpn_1x.py 2
Did you make any modifications on the code or config? Did you understand what you have modified?
I just changed the category
What dataset did you use?
coco dataset
Environment
Please run python mmdet/utils/collect_env.py
to collect necessary environment infomation and paste it here.
sys.platform: linux
Python: 3.7.7 (default, May 7 2020, 21:25:33) [GCC 7.3.0]
CUDA available: True
CUDA_HOME: /usr/local/cuda-10.1
NVCC: Cuda compilation tools, release 10.1, V10.1.243
GPU 0,1,2,3: Tesla V100-DGXS-32GB
GCC: gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
PyTorch: 1.3.1
PyTorch compiling details: PyTorch built with:
TorchVision: 0.4.2
OpenCV: 4.3.0
MMCV: 1.0.4
MMDetection: 1.1.0+unknown
MMDetection Compiler: GCC 7.4
MMDetection CUDA Compiler: 10.1
$PATH
, $LD_LIBRARY_PATH
, $PYTHONPATH
, etc.)Error traceback
If applicable, paste the error trackback here.
Traceback (most recent call last):
File "./tools/train.py", line 142, in <module>
main()
File "./tools/train.py", line 115, in main
cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg)
File "/raid/xuwt/ting/CBNet/mmdet/models/builder.py", line 43, in build_detector
return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/raid/xuwt/ting/CBNet/mmdet/models/builder.py", line 15, in build
return build_from_cfg(cfg, registry, default_args)
File "/raid/xuwt/ting/CBNet/mmdet/utils/registry.py", line 79, in build_from_cfg
return obj_cls(**args)
File "/raid/xuwt/ting/CBNet/mmdet/models/detectors/faster_rcnn.py", line 27, in __init__
pretrained=pretrained)
File "/raid/xuwt/ting/CBNet/mmdet/models/detectors/two_stage.py", line 62, in __init__
self.init_weights(pretrained=pretrained)
File "/raid/xuwt/ting/CBNet/mmdet/models/detectors/two_stage.py", line 70, in init_weights
self.backbone.init_weights(pretrained=pretrained)
File "/raid/xuwt/ting/CBNet/mmdet/models/backbones/db_resnet.py", line 546, in init_weights
load_checkpoint(self, pretrained, strict=False, logger=logger)
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 224, in load_checkpoint
checkpoint = _load_checkpoint(filename, map_location)
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 199, in _load_checkpoint
raise IOError(f'{filename} is not a checkpoint file')
OSError: db-x101-32-4d.pth is not a checkpoint file
2020-08-01 16:42:00,417 - mmdet - INFO - load model from: db-x101-32-4d.pth
Traceback (most recent call last):
File "./tools/train.py", line 142, in <module>
main()
File "./tools/train.py", line 115, in main
cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg)
File "/raid/xuwt/ting/CBNet/mmdet/models/builder.py", line 43, in build_detector
return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/raid/xuwt/ting/CBNet/mmdet/models/builder.py", line 15, in build
return build_from_cfg(cfg, registry, default_args)
File "/raid/xuwt/ting/CBNet/mmdet/utils/registry.py", line 79, in build_from_cfg
return obj_cls(**args)
File "/raid/xuwt/ting/CBNet/mmdet/models/detectors/faster_rcnn.py", line 27, in __init__
pretrained=pretrained)
File "/raid/xuwt/ting/CBNet/mmdet/models/detectors/two_stage.py", line 62, in __init__
self.init_weights(pretrained=pretrained)
File "/raid/xuwt/ting/CBNet/mmdet/models/detectors/two_stage.py", line 70, in init_weights
self.backbone.init_weights(pretrained=pretrained)
File "/raid/xuwt/ting/CBNet/mmdet/models/backbones/db_resnet.py", line 546, in init_weights
load_checkpoint(self, pretrained, strict=False, logger=logger)
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 224, in load_checkpoint
checkpoint = _load_checkpoint(filename, map_location)
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 199, in _load_checkpoint
raise IOError(f'{filename} is not a checkpoint file')
OSError: db-x101-32-4d.pth is not a checkpoint file
Traceback (most recent call last):
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/site-packages/torch/distributed/launch.py", line 253, in <module>
main()
File "/raid/xuwt/anaconda3/envs/detection_cb/lib/python3.7/site-packages/torch/distributed/launch.py", line 249, in main
cmd=cmd)
subprocess.CalledProcessError: Command '['/raid/xuwt/anaconda3/envs/detection_cb/bin/python', '-u', './tools/train.py', '--local_rank=1', 'configs/cbnet/faster_rcnn_db_x101_32x4d_fpn_1x.py', '--launcher', 'pytorch']' returned non-zero exit status 1.
Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!
RuntimeError
RuntimeError: Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'; but device 0 does not equal 1 (while checking arguments for cudnn_convolution)
environment
one computer with 3 gpus(but i only use 2 gpus) ,
gpu : GeForce RTX 2080 Ti
cpu: i7 64g
docker
modified
add os.environ['CUDA_VISIBLE_DEVICES']= '2,1' at the begining of the script file mmdet/tools/train.py
from future import division
import argparse
import copy
import os
import os.path as osp
import time
os.environ['CUDA_VISIBLE_DEVICES']= '2,1'
import mmcv
import torch
from mmcv import Config
from mmcv.runner import init_dist
from mmdet import version
from mmdet.apis import set_random_seed, train_detector
from mmdet.datasets import build_dataset
from mmdet.models import build_detector
from mmdet.utils import collect_env, get_root_logger
dataset
coco2017
bash shell
#!/usr/bin/env bash
PYTHON=${PYTHON:-"python"}
CONFIG_FILE=configs/cbnet/faster_rcnn_db_x101_32x4d_fpn_1x.py
GPUS=2
PORT=${PORT:-29500}
CUDA_VISIBLE_DEVICES=2,1 $PYTHON -m torch.distributed.launch
--nnodes=1
--nproc_per_node=${GPUS}
--master_port=$PORT
tools/train.py ${CONFIG_FILE} --local_rank=1 --launcher pytorch --validate
Using convert_db.py to convert model_zoo models to cbnet version cannot get weights of composite connections, right? If I want to test cbnet version models on coco, after python convert_db.py, I have to train a model by tools/train.py . Is there any error in my understanding? Or could you tell me where to find the cbnet model which can be tested on coco directly?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.