Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to use polarmask but there is no config for single gpu! #11

Closed
bat3a opened this issue Nov 18, 2019 · 15 comments
Closed

trying to use polarmask but there is no config for single gpu! #11

bat3a opened this issue Nov 18, 2019 · 15 comments

Comments

@bat3a
Copy link

bat3a commented Nov 18, 2019

trying to use Polarmask but there is no config for single gpu! there is only for 4, 32 gpu in the config folder, is there away to test single gpu?

@xieenze
Copy link
Owner

xieenze commented Nov 18, 2019

hi
PolarMask is just based on mmdetection. You can find some examples in https://github.com/open-mmlab/mmdetection/blob/v1.0rc0/GETTING_STARTED.md.

For example, if you want to test on single gpu or multi-gpu , you can try this

# single-gpu testing
python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}] [--show]

# multi-gpu testing
./tools/dist_test.sh ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}]

@bat3a
Copy link
Author

bat3a commented Nov 19, 2019

thanks for the fast response, i already modified the config and downloaded the retrained model:

config_file = '../configs/polarmask/4gpu/polar_768_1x_r101.py'
checkpoint_file = '../work_dirs/r101_1x.pth'

but i am trying to run the visualize jupyter notebook code, i get the following error:
KeyError: 'PolarMask is not in the detector registry'

i verfied i can import mmdet, any help would be appreciated.

@ZhongYingMatrix
Copy link

@bat3a git pull and remake?

@bat3a
Copy link
Author

bat3a commented Nov 19, 2019

@ZhongYingMatrix for what repo, mmcv, mmdet?! both are latest

@xieenze
Copy link
Owner

xieenze commented Nov 19, 2019

@bat3a
Sorry, I don't know what's wrong with you. Maybe you can refer to this issue.

The only potential problem is that I found I changed the name of convs in the later version,
but the published model is out-dated.
So I upload the new model in google drive and I test it can work.

You can re-download the code and the trained model to test it again. I think you can successfully run demo in this way.

@bat3a
Copy link
Author

bat3a commented Nov 20, 2019

@xieenze i have installed all the necessary libs and can run the demos in the mmdetection successfully,
but when i try to run the notebook in the polarmask/demo i get this error:

image

what should i do to register the polarmask with mmdet?! thanks in advance.

@xieenze
Copy link
Owner

xieenze commented Nov 20, 2019

@bat3a
Do you follow my advice that re-download the code and the model?

@bat3a
Copy link
Author

bat3a commented Nov 20, 2019

@bat3a
Do you follow my advice that re-download the code and the model?

yes the code is up to date and i redownloaded the .pth file today.

@bat3a
Copy link
Author

bat3a commented Nov 24, 2019

if it helps my folders arranged like this:
Desktop
|------mmdetection
|------Polarmask

also i use ubuntu 18.04, cuda 9.2.

@bat3a
Copy link
Author

bat3a commented Nov 25, 2019

@xieenze can you tell me if i mmdetection should be installed? as per instructions, as there is an mmdet folder of the lib in the polarmask folder and i think it conflicts with the installation!

@xieenze
Copy link
Owner

xieenze commented Nov 26, 2019

@bat3a
You do not need to download mmdetection.
You only need to download PolarMask and install, same as mmdetection.

@bat3a
Copy link
Author

bat3a commented Nov 26, 2019

thanks that worked
the problem was in the installation instruction, it says clearly that you need to install mmdetection which is confusing!
ins

@bat3a bat3a closed this as completed Nov 26, 2019
@xieenze
Copy link
Owner

xieenze commented Nov 27, 2019

@bat3a
Hello,
Sorry to make you confuse. I just want to say the install process is same as MMDetection.........=-=

@wufan-zhao
Copy link

@xieenze hi Enze, fabulous work! However, I met the same issue as @bat3a did when running the demo notebook. I know this project is built based on mmdetection, but the instruction for installing and configuration is a bit confusing indeed. I would suggest re-write an independent installing instruction just for polarmask.
Now I have built two separate envs for mmdetection and polarmask separately, but I encountered another error:


ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from mmdet.apis import init_detector, inference_detector, show_result_pyplot
2 import mmcv

~/Projects/PolarMask/mmdet/apis/init.py in
1 from .env import get_root_logger, init_dist, set_random_seed
----> 2 from .inference import (inference_detector, init_detector, show_result,
3 show_result_pyplot)
4 from .train import train_detector
5

~/Projects/PolarMask/mmdet/apis/inference.py in
8 from mmcv.runner import load_checkpoint
9
---> 10 from mmdet.core import get_classes
11 from mmdet.datasets import to_tensor
12 from mmdet.datasets.transforms import ImageTransform

~/Projects/PolarMask/mmdet/core/init.py in
1 from .anchor import * # noqa: F401, F403
2 from .bbox import * # noqa: F401, F403
----> 3 from .evaluation import * # noqa: F401, F403
4 from .fp16 import * # noqa: F401, F403
5 from .mask import * # noqa: F401, F403

~/Projects/PolarMask/mmdet/core/evaluation/init.py in
3 voc_classes)
4 from .coco_utils import coco_eval, fast_eval_recall, results2json
----> 5 from .eval_hooks import (CocoDistEvalmAPHook, CocoDistEvalRecallHook,
6 DistEvalHook, DistEvalmAPHook)
7 from .mean_ap import average_precision, eval_map, print_map_summary

~/Projects/PolarMask/mmdet/core/evaluation/eval_hooks.py in
11 from torch.utils.data import Dataset
12
---> 13 from mmdet import datasets
14 from .coco_utils import fast_eval_recall, results2json
15 from .mean_ap import eval_map

~/Projects/PolarMask/mmdet/datasets/init.py in
1 from .builder import build_dataset
----> 2 from .cityscapes import CityscapesDataset
3 from .coco import CocoDataset
4 from .custom import CustomDataset
5 from .dataset_wrappers import ConcatDataset, RepeatDataset

~/Projects/PolarMask/mmdet/datasets/cityscapes.py in
1 from .coco import CocoDataset
2 from .registry import DATASETS
----> 3 from .coco_seg import Coco_Seg_Dataset
4
5

~/Projects/PolarMask/mmdet/datasets/coco_seg.py in
6 import cv2
7 import math
----> 8 import Polygon as plg
9 from tqdm import tqdm
10

ModuleNotFoundError: No module named 'Polygon'.
The mmdetection runs well, but not this. what would be the potential cause of this error?

Second, I would also like to ask "how can I retrain the model on single gpu?" many thanks

@LittleQQ
Copy link

thanks for the fast response, i already modified the config and downloaded the retrained model:

config_file = '../configs/polarmask/4gpu/polar_768_1x_r101.py'
checkpoint_file = '../work_dirs/r101_1x.pth'

but i am trying to run the visualize jupyter notebook code, i get the following error:
KeyError: 'PolarMask is not in the detector registry'

i verfied i can import mmdet, any help would be appreciated.

hi
PolarMask is just based on mmdetection. You can find some examples in https://github.com/open-mmlab/mmdetection/blob/v1.0rc0/GETTING_STARTED.md.

For example, if you want to test on single gpu or multi-gpu , you can try this

# single-gpu testing
python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}] [--show]

# multi-gpu testing
./tools/dist_test.sh ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}]

i has same problem , Have you solved the problem now?expect your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants