fyu / drn

Dilated Residual Networks

Home Page:https://www.vis.xyz/pub/drn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError: 'epoch'

UpCoder opened this issue · comments

I try to execute

python3 -u /home/dl-box/ld/github/drn/segment.py test -d=/media/dl-box/HDD3/ld/Documents/datasets/CITYSCAPES -c=19 --arch=drn_d_22 --resume=/home/dl-box/ld/github/drn/pretrained/city_seg/drn_d_22_cityscapes.pth --phase=test --batch-size=1

However, It will meet the Error like this:

Traceback (most recent call last):
  File "/home/dl-box/ld/github/drn/segment.py", line 748, in <module>
    main()
  File "/home/dl-box/ld/github/drn/segment.py", line 744, in main
    test_seg(args)
  File "/home/dl-box/ld/github/drn/segment.py", line 658, in test_seg
    start_epoch = checkpoint['epoch']
KeyError: 'epoch'

And I try to look the key of checkpoint, the result are:

key is  base.0.0.weight
key is  base.0.1.weight
key is  base.0.1.bias
key is  base.0.1.running_mean
key is  base.0.1.running_var
key is  base.1.0.weight
key is  base.1.1.weight
key is  base.1.1.bias
key is  base.1.1.running_mean
key is  base.1.1.running_var

I try to use torch-0.3.1 torch-0.4.0 and torch-1.0. All meet the same error.
Do you know how to solve it?
Thank you very much!

You need to change --resume to --pretrained.