fix the retrain model to eager closes #78

This commit is contained in:
Andre Henriques 2024-04-14 16:51:15 +01:00
parent 5f11126acd
commit 095a37189d
2 changed files with 3 additions and 3 deletions

View File

@ -350,7 +350,7 @@ func generateCvsExpandExp(c *Context, run_path string, model_id string, offset i
return
}
if file_path == "id://" {
f.Write([]byte(id + "," + strconv.Itoa(-1) + "\n"))
f.Write([]byte(id + "," + strconv.Itoa(-2) + "\n"))
} else {
return count, errors.New("TODO generateCvs to file_path " + file_path)
}
@ -529,7 +529,7 @@ func trainDefinitionExpandExp(c *Context, model *BaseModel, definition_id string
if err != nil {
return
}
os.RemoveAll(run_path)
c.Logger.Info("Model finished training!", "accuracy", accuracy)
return

View File

@ -49,7 +49,7 @@ def pathToLabel(path):
num = table.lookup(tf.strings.as_string([path]))
return tf.cond(
tf.math.equal(num, tf.constant(-1)),
tf.math.equal(num, tf.constant(-2)),
lambda: tf.zeros([depth]),
lambda: tf.one_hot(table.lookup(tf.strings.as_string([path])) - diff, depth)[0]
)