问题描述
如果您能在Clarifai API的问题上为我提供帮助,我将不胜感激.
I'll be thankful if you can assist me on an issue with Clarifai API.
我使用API对人脸检测进行了简单的应用.我遵循了文档,并从客户端运行了以下代码片段:
I made a simple application of Face Detection using the API.I've followed the documentation and from my client I ran the following code snippet:
app.models
.predict(Clarifai.FACE_DETECT_MODEL, this.state.input)
.then((response) => setImageBox(this.calculateBox(response)))
.catch((err) => {
console.log("Clarifai Error:", err);
});
它一直可以工作到2天前.现在我得到一个错误.Chrome开发工具在网络"->标题"标签上向我显示:
It used to work until 2 days ago.Now I get an error.Chrome Dev Tool shows me on the Network->Headers tab:
请求网址: https://api.clarifai.com/v2/models/a403429f2ddf4b49b307e318f00e528b/输出请求方法:POST状态码:404未找到远程地址:54.208.138.170:443推荐人政策:降级时不推荐人
Request URL: https://api.clarifai.com/v2/models/a403429f2ddf4b49b307e318f00e528b/outputsRequest Method: POSTStatus Code: 404 Not FoundRemote Address: 54.208.138.170:443Referrer Policy: no-referrer-when-downgrade
在网络上->响应选项卡,我得到此错误对象:
On the Network-> Response tab I get this error object:
{状态":{代码":21200,描述":模型不存在",细节":未找到ID为'a403429f2ddf4b49b307e318f00e528b'的模型.检查您的请求的网址.","req_id":"2fc7d5ed414a48eead697d9bdcf187b7"},输出":[]}
{"status":{"code":21200,"description":"Model does not exist","details":"A model with ID 'a403429f2ddf4b49b307e318f00e528b' not found.Check the url of your request.","req_id":"2fc7d5ed414a48eead697d9bdcf187b7"},"outputs":[]}
我什至尝试重新安装Clarifai NPM软件包,但没有任何改变.当我查看Clarifai.FACE_DETECT_MODEL的值时,确实是a403429f2ddf4b49b307e318f00e528b的ID,但Clarifai服务器无法识别它.
I even tried to reinstall the Clarifai NPM package but nothing has changed.When I looked the value of Clarifai.FACE_DETECT_MODEL it's indeed the ID of a403429f2ddf4b49b307e318f00e528b but the Clarifai servers don't recognize it.
这是Clarifai API的错误吗?
Is it a bug of the Clarifai API?
该问题如何解决?
谢谢,以利
推荐答案
当我使用perdict函数按模型版本ID时,该问题已解决.
The issue was solved when I used the perdict function By Model Version ID.
因此,代码段如下:
app.models
.predict(
{
id: "a403429f2ddf4b49b307e318f00e528b",
version: "34ce21a40cc24b6b96ffee54aabff139",
},
this.state.input
)
.then((response) => setImageBox(this.calculateBox(response)))
.catch((err) => {
console.log("Clarifai Error:", err);
});
我要感谢Clarifai支持团队解决此问题.
I would like to thank the Clarifai support team for solving this issue.
保持安全!
这篇关于Clarifai-脸部检测-模型不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!