I'm trying to publish my Custom Vision Iteration after I trained it. But I always get a "Bad Request" Error.
I'm trying with the following line of code:
trainingApi.PublishIteration(ProjectID, iteration.Id, "Model", predictionResourceId);
It should Publish my Iteration but I just get an error.
I re-checked all my ID's but everything looks fine. Has the model name be something specific (start with lower letter or something)?
Edit:
I tried it now with a POST Request in Postman but now I receive:
{
"code": "BadRequestInvalidPublishTarget",
"message": "Invalid prediction resource id"
}
But I re-checked my Prediction Resource ID and it's correct.
Edit 2:
I thin I put the wrong thing into predictionId in the POST request, I just put in a ID but I think it should have been the /subscriptions/... part like described by microsoft. The problem now is:
{
"code": "BadRequestInvalidPublishTarget",
"message": "Invalid prediction id, please pass a prediction resource id."
}
For me this means it doesn't receive a prediction resource id, but I'm lost so I'm out of ideas what the problem could be.
Edit 3:
I forgot to add my POST Request:
https://xxx.cognitiveservices.azure.com/customvision/v3.0/training/projects/xxx/
iterations/xxx/publish?publishName=Model&predictionId=/subscriptions/xxx/
resourceGroups/CustomVision/providers/Microsoft.CognitiveServices/accounts/xxx