美文网首页
【总结经验】炼丹路上的坑与经验

【总结经验】炼丹路上的坑与经验

作者: keloli | 来源:发表于2018-01-23 20:25 被阅读195次

    戳我进入本文长期更新地址
    训练的神经网络不工作?一文带你跨过这37个坑

    • 深度学习这些坑你都遇到过吗?

    • 用Keras(后端是TensorFlow)跑一个epoch时报错:IOError: image file is truncated
      解决办法: 在*.py文件最上方加入:

      from PIL import Image
      from PIL import ImageFile
      ImageFile.LOAD_TRUNCATED_IMAGES = True
      
    • 用Sequential.fit_generator()时要注意steps_per_epoch的区别,keras 中 fit_generator参数steps_per_epoch已经改变含义了,目前的含义是一个epoch分成多少个batch_size。旧版的含义是一个epoch的样本数目。
      https://keras.io/models/sequential/#fit_generator

    • 在二分类问题中,最后一层的激活函数用sigmodsoftmax要提升正确率约10%

    • 用两层Dense不如用一层的

    • keras 优化下降:multistep(没有试)

    • 把全连接层换成全卷积

    • resnet的二分类class_mode选择categorical而不是binary

        validation_generator=test_datagen.flow_from_directory(
        validation_data_dir,
        target_size=(img_width, img_height),
        batch_size=batch_size,
        class_mode='categorical')
    

    相关文章

      网友评论

          本文标题:【总结经验】炼丹路上的坑与经验

          本文链接:https://www.haomeiwen.com/subject/osjeaxtx.html