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

Non-existent config key: MODEL.BACKBONE.OUT_CHANNELS #7

Closed
TheFloe1995 opened this issue Mar 6, 2019 · 6 comments
Closed

Non-existent config key: MODEL.BACKBONE.OUT_CHANNELS #7

TheFloe1995 opened this issue Mar 6, 2019 · 6 comments

Comments

@TheFloe1995
Copy link

I followed the installation instructions and everything went fine until wanted to test the pre-trained model by executing:

python tools/test_net.py --config-file ./configs/retina/retinanet_mask_R-50-FPN_2x_adjust_std011_ms.yaml MODEL.WEIGHT ./models/retinanet_mask_R-50-FPN_2x_adjust_std011_ms_model.pth MODEL.MASK_ON False

This leads to the following error:

Traceback (most recent call last):
  File "tools/test_net.py", line 100, in <module>
    main()
  File "tools/test_net.py", line 55, in main
    cfg.merge_from_file(args.config_file)
  File "/home/flo/anaconda3/envs/uav-challenge/lib/python3.6/site-packages/yacs/config.py", line 213, in merge_from_file
    self.merge_from_other_cfg(cfg)
  File "/home/flo/anaconda3/envs/uav-challenge/lib/python3.6/site-packages/yacs/config.py", line 217, in merge_from_other_cfg
    _merge_a_into_b(cfg_other, self, self, [])
  File "/home/flo/anaconda3/envs/uav-challenge/lib/python3.6/site-packages/yacs/config.py", line 460, in _merge_a_into_b
    _merge_a_into_b(v, b[k], root, key_list + [k])
  File "/home/flo/anaconda3/envs/uav-challenge/lib/python3.6/site-packages/yacs/config.py", line 460, in _merge_a_into_b
    _merge_a_into_b(v, b[k], root, key_list + [k])
  File "/home/flo/anaconda3/envs/uav-challenge/lib/python3.6/site-packages/yacs/config.py", line 473, in _merge_a_into_b
    raise KeyError("Non-existent config key: {}".format(full_key))
KeyError: 'Non-existent config key: MODEL.BACKBONE.OUT_CHANNELS'

Any ideas?

@chengyangfu
Copy link
Owner

Hi,
How did you install the code? Looks like you install the different repository.
MODEL.BACKBONE.OUT_CHANNELS is still valid in this repository but is removed in the master branch of maskrcnn-benchmark.
Try to recompile the code.
rm -rf build python setup.py build develop

@TheFloe1995
Copy link
Author

Hi,
thanks for your fast reply. I blindly followed the installation instructions and therefore completely overlooked that there is a maskrcnn_benchmark directory included in this repository along with a setup.py in the root dir.
I downloaded and installed maskrcnn_benchmark repo separately and that of course caused problems, as you pointed out.

@ahong007007
Copy link

I've got the same problem, and there's no solution at this time.

@chengyangfu
Copy link
Owner

Hi @ahong007007,
I guess you had installed the maskrcnn-benchmark. Can you uninstall it first and try again? It will be great if you can also copy & paste the error messages.

@ahong007007
Copy link

from maskrcnn_benchmark.config import cfg
from predictor import COCODemo
import cv2
config_file = "./e2e_mask_rcnn_X_101_32x8d_FPN_1x_caffe2.yaml"
cfg.merge_from_file(config_file)
cfg.merge_from_list(["MODEL.DEVICE", "cpu"])
print(cfg)
coco_demo = COCODemo(
cfg,
min_image_size=800,
confidence_threshold=0.7,
)
def imshow(img):
plt.imshow(img[:, :, [2, 1, 0]])
plt.axis("off")
image = cv2.imread("./00019_48a40bf59425c4cea437dabe659746b0.jpg")
predictions = coco_demo.run_on_opencv_image(image)
cv2.imwrite("test.jpg",predictions)

Expected behavior
Environment
image

I just load a configuration yaml file

cfg.merge_from_file(config_file)

[environment collection script from PyTorch]
image
I just load a configuration yaml file

cfg.merge_from_file(config_file)

image

You can get the script and run it with:

PyTorch Version (e.g., 1.0): torch-nightly 1.0.0.dev20190312
torchvision-nightly 0.2.1

OS (e.g., Linux): Linux 2de17d7e2498 3.10.0-327

How you installed PyTorch (conda, pip, source):
pip install numpy torchvision_nightly
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html

Build command you used (if compiling from source):

Python version: py3.6

CUDA/cuDNN version: 9.0

GPU models and configuration:

Any other relevant information:

@chengyangfu
Copy link
Owner

chengyangfu commented Mar 14, 2019

Obviously, there is a different version of maskrcnn-benchmark in your pip. You need to remove it first and then run
python setup.py build develop
under the root directory of retinamask.

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

3 participants