InnerPeace-Wu / densecap-tensorflow

Re-implement CVPR2017 paper: "dense captioning with joint inference and visual context" and minor changes in Tensorflow. (mAP 8.296 after 500k iters of training)
MIT License
61 stars 28 forks source link

使用resnet v2作为基本模型 #16

Closed Dontfall closed 6 years ago

Dontfall commented 6 years ago

你好,因为 tensorflow/contrib/slim/python/slim/nets/resnet_v1.py 和tensorflow/contrib/slim/python/slim/nets/resnet_v2.py 极其相似,所以我将 lib/nets/resnet_v1.py 中的出现resnet_v1的地方替换为resnet_v2,作为resnet_v2.py,但是resnet_v1.py 依旧保留。

另外,我在 tools/train_net.py 中,也做了相应的修改,导入了resnetv2(from lib.nets.resnet_v2 import resnetv2)。在#load network也做了些修改,如下:

load network

if args.net == 'vgg16':
    net = vgg16()
elif args.net == 'resnet_v1_50':
    net = resnetv1(num_layers=50)
elif args.net == 'resnet_v1_101':
    net = resnetv1(num_layers=101)
elif args.net == 'resnet_v1_152':
    net = resnetv1(num_layers=152)
elif args.net == 'resnet_v2_50':
    net = resnetv2(num_layers=50)
elif args.net == 'resnet_v2_101':
    net = resnetv2(num_layers=101)
elif args.net == 'resnet_v2_152':
    net = resnetv2(num_layers=152)
else:
    raise NotImplementedError

当训练模型时,出现以下错误,希望能得到您的建议,谢谢!!@InnerPeace-Wu

~/densecap-tensorflow$ bash scripts/dense_cap_train.sh visual_genome_1.2 resnet_v2_50 /home/xiewei/densecap-tensorflow/slim_models/resnet_v2_50.ckpt /home/xiewei/densecap-tensorflow/visual_genome 1

Dontfall commented 6 years ago

I have solved this the problem. thanks.

ktr-hubrt commented 5 years ago

请问你是怎么解决的呀