I got the following error:
The Error message doesn't really tell me anything, but I also don't see my usage which is a problem. Has anybody encountered this?
Edit:
Here is how I create my Project (If it doesnt' exist). I basically just copied everything from the documentation.
And after the project is created and I go to the website the error shows up.
public partial class Validation : Page
{
private const string endpoint = "https://dcd-prediction.cognitiveservices.azure.com/";the portal
private string trainingKey = ConfigurationManager.AppSettings["trainingKey"];
private string predictionKey = ConfigurationManager.AppSettings["predictionkey"];
private List<Tag> tags = new List<Tag>();
private static MemoryStream testImage;
private Iteration iteration;
private string publishedModelName;
private Guid ProjectID = Guid.Parse(ConfigurationManager.AppSettings["projectKey"]);
Project project = null;
CustomVisionTrainingClient TrainingApi = null;
CustomVisionPredictionClient predictionApi = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.User.IsInRole("Admin"))
Response.Redirect("/");
TrainingApi = AuthenticateTraining(endpoint, trainingKey);
project = GetProject(TrainingApi);
UpdateTags(TrainingApi, project);
if (TrainingApi is null || predictionApi is null || project is null)
{
alert("");
}
}
private Project GetProject(CustomVisionTrainingClient trainingApi)
{
try
{
return trainingApi.GetProject(ProjectID);
}
catch
{
return trainingApi.CreateProject("DCD");
}
}
private CustomVisionTrainingClient AuthenticateTraining(string endpoint, string trainingKey)
{
// Create the Api, passing in the training key
CustomVisionTrainingClient trainingApi = new CustomVisionTrainingClient(new Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.ApiKeyServiceClientCredentials(trainingKey))
{
Endpoint = endpoint
};
return trainingApi;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…