version 1.2.1
$ pip install https://github.com/benchuang11046/afs/archive/1.2.1.zip
version 1.1.3
$ pip install https://github.com/benchuang11046/afs/archive/1.1.3.zip
To build the library run :
$ python setup.py install
python-3.X
config_handler:提供開發者用於node-red串接資料SDK。使用範例連結。
def upload_model(model_name, accuracy, loss, tags={}, extra_evaluation={}):
"""
Upload model_name to model repository.If model_name is not exists in the repository, this function will create one.
:rtype: None
:param model_name: (required) string, model path or name
:param accuracy: (required) float, model accuracy value
:param loss: (required) float, model loss value
:param tags: (optional) dict, tag from model
:param extra_evaluation: (optional) dict, other evaluation from model
"""
from afs import models
with open('model.h5', 'w') as f:
f.write('dummy model')
afs_models = models()
afs_models.upload_model('model.h5', accuracy=0.4, loss=0.3, tags=dict(machine='machine01'))
# 執行成功不回傳,執行失敗將raise原因
from afs import models
with open('model.h5', 'w') as f:
f.write('dummy model')
client = models(afs_url, instance_id, auth_code )
client.upload_model('model.h5', accuracy=0.4, loss=0.3, tags=dict(machine='machine01'))
# 執行成功不回傳,執行失敗將raise原因