Res2Net/Res2Net-detectron2

cannot import name 'cfg' from 'detectron2.config'

Closed this issue · 8 comments

when i try "python ./tools/train_net.py --config-file "configs/COCO-PanopticSegmentation/panoptic_fpn_R2_101_3x.yaml" --num-gpus"
i got the error ." cannot import name 'cfg' from 'detectron2.config'"

gasvn commented

Have you build and installed this repo with python -m pip install -e detectron2 ?

Have you build and installed this repo with python -m pip install -e detectron2 ?

yes, I installed detectron2 .

and in folder "config" "init.py", there is no ‘cfg’ in ‘all '

gasvn commented

I can run this repo with the following steps:
step1: git clone https://github.com/Res2Net/Res2Net-detectron2.git
step2: python -m pip install -e Res2Net-detectron2
step3: get r2_101.pkl
step4: get dataset
step5: ./tools/train_net.py --num-gpus 8 --config-file configs/COCO-PanopticSegmentation/panoptic_fpn_R2_101_3x.yaml

You have to install this repo Res2Net-detectron2, not the detectron2 from facebook.

I do this in step2 on dir "Res2Net-detectron2" : "python -m pip install -e ."
and successfully installed detectron2
when i run exactly as you type "python -m pip install -e Res2Net-detectron2"
I got error: "ERROR: Res2Net-detectron2 is not a valid editable requirement. It should either be a path to a local project or a VCS URL"

I can run this repo with the following steps:
step1: git clone https://github.com/Res2Net/Res2Net-detectron2.git
step2: python -m pip install -e Res2Net-detectron2
step3: get r2_101.pkl
step4: get dataset
step5: ./tools/train_net.py --num-gpus 8 --config-file configs/COCO-PanopticSegmentation/panoptic_fpn_R2_101_3x.yaml

You have to install this repo Res2Net-detectron2, not the detectron2 from facebook.

gasvn commented

I suggest you to try my steps as I have tested it just now.

gasvn commented

I do this in step2 on dir "Res2Net-detectron2" : "python -m pip install -e ."
and successfully installed detectron2
when i run exactly as you type "python -m pip install -e Res2Net-detectron2"
I got error: "ERROR: Res2Net-detectron2 is not a valid editable requirement. It should either be a path to a local project or a VCS URL"

I can run this repo with the following steps:
step1: git clone https://github.com/Res2Net/Res2Net-detectron2.git
step2: python -m pip install -e Res2Net-detectron2
step3: get r2_101.pkl
step4: get dataset
step5: ./tools/train_net.py --num-gpus 8 --config-file configs/COCO-PanopticSegmentation/panoptic_fpn_R2_101_3x.yaml
You have to install this repo Res2Net-detectron2, not the detectron2 from facebook.

git clone and DO NOT cp into the Res2Net-detectron2. And run python -m pip install -e Res2Net-detectron2

oh, Thx, I can train now!

gasvn commented

glad to hear that.