davidMcneil / mnist

MNIST data set parser https://crates.io/crates/mnist
20 stars 9 forks source link

panicked at 'Unable to find path to images at "data/train-images-idx3-ubyte".' #13

Open JiatLn opened 1 year ago

JiatLn commented 1 year ago

here are some test code

use mnist::MnistBuilder;

#[test]
fn test_mnist() {

    let mnist = MnistBuilder::new()
        .label_format_digit()
        .training_set_length(50_000)
        .validation_set_length(10_000)
        .test_set_length(10_000)
        .finalize();

    dbg!(mnist.trn_img);
    dbg!(mnist.trn_lbl);
}
[dependencies]
mnist = "0.5.0"

and got error

running 1 test
thread 'test_mnist' panicked at 'Unable to find path to images at "data/train-images-idx3-ubyte".'

how could i fix it?

mr-brobot commented 9 months ago

Are the files present on your machine? The setup docs give some helpful context.

MnistBuilder::download_and_extract also looks helpful.

77Tigers commented 2 weeks ago

I had the same issue but it was because the files I downloaded had a "." instead of a "-" somewhere.