tf-faster-rcnn icon indicating copy to clipboard operation
tf-faster-rcnn copied to clipboard

get_variables_to_restore if v.name.split(':')[0] in var_keep_dic: TypeError: argument of type 'NoneType' is not iterable

Open chenyuqing opened this issue 6 years ago • 7 comments

When I run "./experiments/scripts/train_faster_rcnn.sh 0 pascal_voc res50 ", it occurs the error: Traceback (most recent call last): File "./tools/trainval_net.py", line 142, in max_iters=args.max_iters) File "/home/honghaier1688/workspaces/tf-faster-rcnn/tools/../lib/model/train_val.py", line 377, in train_net sw.train_model(sess, max_iters) File "/home/honghaier1688/workspaces/tf-faster-rcnn/tools/../lib/model/train_val.py", line 255, in train_model rate, last_snapshot_iter, stepsizes, np_paths, ss_paths = self.initialize(sess) File "/home/honghaier1688/workspaces/tf-faster-rcnn/tools/../lib/model/train_val.py", line 188, in initialize variables_to_restore = self.net.get_variables_to_restore(variables, var_keep_dic) File "/home/honghaier1688/workspaces/tf-faster-rcnn/tools/../lib/nets/resnet_v1.py", line 162, in get_variables_to_restore if v.name.split(':')[0] in var_keep_dic: TypeError: argument of type 'NoneType' is not iterable Command exited with non-zero status 1 89.08user 1.66system 1:29.76elapsed 101%CPU (0avgtext+0avgdata 1418052maxresident)k 8inputs+372056outputs (0major+676350minor)pagefaults 0swaps

chenyuqing avatar May 25 '18 07:05 chenyuqing

so have u fixed it and how?

lvZic avatar Jul 12 '18 02:07 lvZic

@lz2004xxw hi,have you sloved this problem?

Amerry-c avatar Jul 18 '18 09:07 Amerry-c

@Amerry-c i fixed it by using the absolute model path instead of the relative one.

lvZic avatar Jul 21 '18 02:07 lvZic

i meet this problem when i want to reload the pascal_voc model to finetune on my own dataset.

i failed because the code couldnt reload the weight correcttly

i just put the weight on the ./date/imagenet_weights/

rename the .cpkt file to res101.ckpt

so i think some thing must be done before reload the pretrain model by the pascal_voc including the cnn and the rnp.

randomtutu avatar Jul 30 '18 03:07 randomtutu

There are two possibilities for error: 1.you weight name incorrectness
2.The default path is relative we can change that train_faster_rcnn.sh --weight (you path)/data/imagenet_weights/${NET}.ckpt

2206487433 avatar Apr 06 '19 07:04 2206487433

There are two possibilities for error: 1.you weight name incorrectness 2.The default path is relative we can change that train_faster_rcnn.sh --weight (you path)/data/imagenet_weights/${NET}.ckpt

thank you for your suggestions!

conquerSelf avatar Oct 29 '19 10:10 conquerSelf

First,my weight name is 'vgg16.ckpt',but also this problem,i can not solve this problem. It cost my 3 hours to find my path name which including 'vgg16.ckpt' should be 'imagenet_weights' instead of 'imagenet_weight'.This issue told me the detail is very important,oh,my god.

huiyyds avatar Feb 18 '22 18:02 huiyyds