You're removing non-existing directory in the main function:
fn main() -> Result<(), Box<dyn Error>> {
let mut dir = env::temp_dir();
dir.push("tf-rust-example-xor-saved-model");
fs::remove_dir_all(&dir)?; //<- The directory isn't created yet.
train(&dir)?;
eval(&dir)?;
Ok(())
}
And therefore appears the error:
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
You need replace it after the eval or add something like:
if Path::new(&dir).is_dir(){
fs::remove_dir_all(&dir)?;
}
You're removing non-existing directory in the main function:
And therefore appears the error:
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
You need replace it after the eval or add something like: