我正在尝试使用人口统计模型https://www.clarifai.com/blog/socially-responsible-pixels-a-look-inside-clarifais-new-demographics-recognition-model。
但我很困惑,因为 Demographics 是模型还是工作流程?
我尝试在仪表板的模型模式中搜索人口统计数据,但它不存在。
App Workflows 中有一个 Demographics 工作流,但是当我访问它时,我会收到错误通知。这可能就是为什么当我运行服务器以使用 Demographics 检测图像时,它会导致“模型不存在”错误。
A model with ID '6c276d1ee3cac072fad9d6d850b4a429' not found. Check the url of your request.
这是代码,我正在使用nodejs。
const { ClarifaiStub, grpc } = require("clarifai-nodejs-grpc");
const stub = ClarifaiStub.grpc();
const metadata = new grpc.Metadata();
metadata.set("authorization", "Key {MY_SECRET_KEY}");
const inputs = [
{
data: {
image: {
url:
"https://www.gannett-cdn.com/-mm-/b2b05a4ab25f4fca0316459e1c7404c537a89702/c=0-0-1365-768/local/-/media/2020/08/19/USATODAY/usatsports/GettyImages-1147443912.jpg?width=660&height=372&fit=crop&format=pjpg&auto=webp",
},
},
},
];
stub.PostModelOutputs(
{
workflow_id: "Demographics",
inputs,
},
metadata,
(err: any, response: any) => {
if (err) {
console.log("Error: " + err);
return;
}
console.log(response); // Model doesn't exist
}
);
响应输出
{
outputs: [],
status: {
stack_trace: [],
code: 21200,
description: 'Model does not exist',
details: "Model '' does not exist.",
percent_completed: 0,
time_remaining: 0,
req_id: 'a9575417a32a4e2597443f4b400be39b',
internal_details: ''
}
}