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
run10_common_onimage.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录