TheLegendAli / DeepLab-Context2

Other
42 stars 32 forks source link

KeyError: 'DEEPLABV2-RESNET101-url' #6

Open mjohn123 opened 7 years ago

mjohn123 commented 7 years ago

Hello all, I am using the code and got the error as following: KeyError: 'DEEPLABV2-RESNET101-url' This is my runing steps; First, I clone the code to my /home/john folder: /home/john/DeepLab-Context2. Then I build the code without error as follows:

[100%] Built target pycaffe

Secondly, I download DEEPLABV2-RESNET101 testing/training model and put them in the folder /home/john/DeepLab-Context2/voc12/model/vgg128_noup. Then I run the command

"ln -s vgg16.caffemodel init.caffemodel" at /home/john/DeepLab-Context2/voc12/model/vgg128_noup

I also changed the Pascal dataset link as

# MODIFY PATH for YOUR SETTING
EXP='voc' #dataset
NET_ID='vgg128_noup' #model name
NUM_LABELS=21
YEAR = 'VOC2012'
EXP= EXP + YEAR[-2:]
DATA_ROOT='/media/john/Study/databaseSeg/pascal/VOCdevkit/VOC2012'
#DATA_ROOT=subprocess.Popen('cd .. && pwd', stdout=subprocess.PIPE, shell=True).communicate()[0][:-1] + '/VOCdevkit/' + YEAR
OLD_ROOT=''#only change if you are changing the path to images
MODEL='DEEPLABV2-RESNET101'

Finally, I run the python code python run.py but I got the above error. How can I fix it? Thank all

DEEPLABV2-RESNET101
Traceback (most recent call last):
  File "run.py", line 71, in <module>
    run(RUN_TRAIN, RUN_TEST, RUN_TRAIN2, RUN_TEST2, RUN_SAVE)
  File "run.py", line 59, in run
    if RUN_TRAIN : trainer()
  File "/home/john/DeepLab-Context2/python/my_script/trainer.py", line 53, in trainer
    model = train_prototxt_maker(train, init, solver, train_set)
  File "/home/john/DeepLab-Context2/python/my_script/trainer.py", line 33, in train_prototxt_maker
    if not os.path.isfile(model): model=model_finder(os.environ['EXP']+ '/model/' + os.environ['NET_ID'])
  File "/home/john/DeepLab-Context2/python/my_script/tools.py", line 15, in model_finder
    url = os.environ[model_url]
  File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'DEEPLABV2-RESNET101-url'
wolf943134497 commented 7 years ago

@mjohn123 @TheLegendAli Did you solve this problem?

tianyu06030020 commented 7 years ago

@mjohn123 MODEL='DEEPLABV2-RESNET101'这个值要改一下 跟tools.py里get_urls()函数里保持一致; image

Tsakunelson commented 6 years ago

I have the same issue you have @mjohn123, did you solve your problem? I will appreciate help on this

Tsakunelson commented 6 years ago

Deeplab implementers help us with this issue please.