keras使用yolov3训练自己的数据时出现- val_loss: nan

先说方法,关闭加载预训练,在train.py进行如下修改

def create_model(input_shape, anchors, num_classes, load_pretrained=False, freeze_body=2,
            weights_path='model_data/yolo_weights.h5'):
def create_tiny_model(input_shape, anchors, num_classes, load_pretrained=False, freeze_body=2,
            weights_path='model_data/tiny_yolo_weights.h5'):

也就是将原来的 load_pretrained=True 修改为 Fasle。
至于原因,一开始我把网上的方法试了一遍都没用,然后我看了一下我的数据集和voc数据集,感觉我的数据集和voc的内容相差特别大,就盲猜关掉预训练,结果就可以了。

版权声明:本文为CSDN博主「硬光」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_30551297/article/details/122904852

硬光

我还没有学会写个人说明!

暂无评论

发表评论

相关推荐

MMdetection之necks之FPN

MMdetection之necks之FPN 其横向为 1X1 的卷积,向下为 上采样 Specifically, for ResNets [16] we use the feature activations output by