问题
I'll be thankful if you can assist me on an issue with Clarifai 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);
});
It used to work until 2 days ago. Now I get an error. Chrome Dev Tool shows me on the Network->Headers tab:
Request URL: https://api.clarifai.com/v2/models/a403429f2ddf4b49b307e318f00e528b/outputs Request Method: POST Status Code: 404 Not Found Remote Address: 54.208.138.170:443 Referrer Policy: no-referrer-when-downgrade
On the Network-> Response tab I get this error object:
{ "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":[] }
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.
Is it a bug of the Clarifai API?
How this issue can be solved?
Thanks, Eli
回答1:
The issue was solved when I used the perdict function By Model Version ID.
Therefore the code snippet is the following:
app.models
.predict(
{
id: "a403429f2ddf4b49b307e318f00e528b",
version: "34ce21a40cc24b6b96ffee54aabff139",
},
this.state.input
)
.then((response) => setImageBox(this.calculateBox(response)))
.catch((err) => {
console.log("Clarifai Error:", err);
});
I would like to thank the Clarifai support team for solving this issue.
Keep Safe!
回答2:
Clarifai Support here!
I apologize for the inconvenience. There was an error that happened on our side. We have resolved that issue and the model should be working fine. Please let us know if you are still receiving this error.
If you are still getting the error, please try using this model_id to get the face model and it should resolve the issue.
model_id= 'a403429f2ddf4b49b307e318f00e528b'
Best Regards, Clarifai Team
来源:https://stackoverflow.com/questions/62516331/clarifai-face-detect-model-does-not-exist