简体   繁体   English

在Watson机器学习上部署使用自定义损失功能训练的模型

[英]Deploy model trained with custom loss function on Watson machine learning

I've trained a model on Watson Machine learning with a custom loss function but when I try to deploy it I get an error saying: 我已经使用自定义损失函数在Watson Machine Learning上训练了一个模型,但是当我尝试部署它时,出现一条错误消息:

Invalid Input data: Unknow loss function:loss

I am aware that normally in Keras you can load a model that have custom loss function using: 我知道通常在Keras中,您可以使用以下命令加载具有自定义损失功能的模型:

load_model('model.h5', custom_object={'loss': loss_function}) 

I am now looking for a way to also add the definition of my loss function in my deployment. 我现在正在寻找一种在部署中也添加损失函数的定义的方法。

You should be able to follow the method described in this doc for Custom Compnents in TF Models for WML 对于WML的Custom Compnents in TF Models您应该能够遵循此文档中描述的方法

https://dataplatform.cloud.ibm.com/docs/content/analyze-data/ml-custom_libs_tensorflow.html?audience=wdp&context=analytics https://dataplatform.cloud.ibm.com/docs/content/analyze-data/ml-custom_libs_tensorflow.html?audience=wdp&context=analytics

the specific requirements are detailed here: https://dataplatform.cloud.ibm.com/docs/content/analyze-data/ml-custom_libs_overview.html#requirements 具体要求在这里详细介绍: https : //dataplatform.cloud.ibm.com/docs/content/analyze-data/ml-custom_libs_overview.html#requirements

The main idea is that you need to specify a runtime for your deployment other thank the default runtime and package up your custom component in the manner specified. 主要思想是,您需要为部署指定运行时, 另外还要感谢默认运行时,并以指定的方式打包自定义组件。 Hope this helps. 希望这可以帮助。

Reply from official support: 官方支持的回复:

Custom functions and layers for Keras aren't currently supported in WML. WML当前不支持Keras的自定义功能和图层。 You can refer to what is supported in this dock: https://dataplatform.cloud.ibm.com/docs/content/analyze-data/pm_service_supported_frameworks.html?audience=wdp&context=analytics It seems the part about loss functions is not mentioned here. 您可以参考此扩展坞中支持的内容: https : //dataplatform.cloud.ibm.com/docs/content/analyze-data/pm_service_supported_frameworks.html? audience = wdp & context = analytics似乎未提及有关损失函数的部分这里。 We will update the documentation. 我们将更新文档。

Date: 2019-01-28 日期: 2019-01-28

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM