run10_common_onimage.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:FCN_MSCOCO_Food_Segmentation 作者: gakarak 项目源码 文件源码
def loadModelFromJson(pathModelJson):
        if not os.path.isfile(pathModelJson):
            raise Exception('Cant find JSON-file [%s]' % pathModelJson)
        tpathBase = os.path.splitext(pathModelJson)[0]
        tpathModelWeights = '%s.h5' % tpathBase
        if not os.path.isfile(tpathModelWeights):
            raise Exception('Cant find h5-Weights-file [%s]' % tpathModelWeights)
        with open(pathModelJson, 'r') as f:
            tmpStr = f.read()
            model = keras.models.model_from_json(tmpStr)
            model.load_weights(tpathModelWeights)
        return model
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号