multiple fixes

This commit is contained in:
2024-05-11 01:11:07 +01:00
parent 0ac6ac8dce
commit 0c0d16c846
34 changed files with 340 additions and 454 deletions

View File

@@ -136,17 +136,16 @@ func processZipFile(c *Context, model *BaseModel) {
return
}
if paths[0] != "training" {
if paths[0] == "training" {
training = InsertIfNotPresent(training, paths[1])
} else if paths[0] != "testing" {
} else if paths[0] == "testing" {
testing = InsertIfNotPresent(testing, paths[1])
}
}
if !reflect.DeepEqual(testing, training) {
c.Logger.Info("Diff", "testing", testing, "training", training)
failed("Testing and Training datesets are diferent")
return
c.Logger.Warn("Diff", "testing", testing, "training", training)
c.Logger.Warn("Testing and traing datasets differ")
}
base_path := path.Join("savedData", model.Id, "data")

View File

@@ -37,7 +37,7 @@ func ReadJPG(scope *op.Scope, imagePath string, channels int64) *image.Image {
return image.Scale(0, 255)
}
func runModelNormal(base BasePack, model *BaseModel, def_id string, inputImage *tf.Tensor) (order int, confidence float32, err error) {
func runModelNormal(model *BaseModel, def_id string, inputImage *tf.Tensor) (order int, confidence float32, err error) {
order = 0
err = nil
@@ -193,7 +193,7 @@ func ClassifyTask(base BasePack, task Task) (err error) {
}
} else {
base.GetLogger().Info("Running model normal", "model", model.Id, "def", def_id)
vi, confidence, err = runModelNormal(base, model, def_id, inputImage)
vi, confidence, err = runModelNormal(model, def_id, inputImage)
if err != nil {
task.UpdateStatusLog(base, TASK_FAILED_RUNNING, "Failed to run model")
return

View File

@@ -1298,12 +1298,6 @@ func generateExpandableDefinition(c BasePack, model *BaseModel, target_accuracy
order++
// handle the errors inside the pervious if block
if err != nil {
failed()
return
}
// Create the blocks
loop := int((math.Log(float64(model.Width)) / math.Log(float64(10))))