Open guiyuliu opened 4 years ago
I solved it. I think authors work lack a var of "cfg" in train_crfnet in line 134:
backbone_retinanet(num_classes, num_anchors=num_anchors, modifier=modifier, inputs=inputs, distance=distance),weights=weights, skip_mismatch=True, config=copy.deepcopy(cfg),num_classes=num_classes)
backbone_retinanet(num_classes, num_anchors=num_anchors, modifier=modifier, inputs=inputs, distance=distance, **cfg = cfg**), weights=weights, skip_mismatch=True, config=copy.deepcopy(cfg), num_classes=num_classes)
@guiyuliu
When multi_gpu=0, the network can be trained smoothly,
but when I change multi_gpu=8, I get the error bellow: It seems likely the cfg cannot be passed to backbone_retinanet. it seems like in train_crfnet.py line 131, backbone_retinanet(num_classes, num_anchors=num_anchors, modifier=modifier, inputs=inputs, distance=distance) cfg=cfg is missed
File "train_crfnet.py", line 424, in
main()
File "train_crfnet.py", line 329, in main
distance_alpha = cfg.distance_alpha
File "train_crfnet.py", line 131, in create_models
model = model_with_weights(backbone_retinanet(num_classes, num_anchors=num_anchors, modifier=modifier, inputs=inputs, distance=distance), weights=weights, skip_mismatch=True, config=copy.deepcopy(cfg), nu
m_classes=num_classes)
File "../crfnet/model/architectures/vgg.py", line 34, in retinanet
return vgg_retinanet(*args, backbone=self.backbone, kwargs)
File "../crfnet/model/architectures/vgg.py", line 101, in vgg_retinanet
vgg = vggmax.custom(input_tensor=inputs, include_top=False, weights=None, cfg=cfg)
File "/root/anaconda3/envs/crfnet2/lib/python3.5/site-packages/keras/applications/init.py", line 28, in wrapper
return base_fun(*args, *kwargs)
File "../crfnet/model/architectures/vggmax.py", line 19, in custom
return vggmax(args, kwargs)
File "../crfnet/model/architectures/vggmax.py", line 149, in vggmax
fusion_blocks = cfg.fusion_blocks
AttributeError: 'NoneType' object has no attribute 'fusion_blocks'
Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x7f4762d369e8>>
Traceback (most recent call last):
File "/root/anaconda3/envs/crfnet2/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 738, in del