Skip to content

terminate called after throwing an instance of 'c10::Error' #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
navkirat25 opened this issue Sep 19, 2021 · 2 comments
Closed

terminate called after throwing an instance of 'c10::Error' #932

navkirat25 opened this issue Sep 19, 2021 · 2 comments
Labels

Comments

@navkirat25
Copy link

terminate called after throwing an instance of 'c10::Error'
what(): Error opening images file at ./data/train-images-idx3-ubyte
Exception raised from read_images at ../torch/csrc/api/src/data/datasets/mnist.cpp:67 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) + 0x69 (0x7f94f2a259f9 in /home/tensorbook/Downloads/libtorch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) + 0xd2 (0x7f94f2a22012 in /home/tensorbook/Downloads/libtorch/lib/libc10.so)
frame #2: + 0x3e1dc54 (0x7f94e3983c54 in /home/tensorbook/Downloads/libtorch/lib/libtorch_cpu.so)
frame #3: torch::data::datasets::MNIST::MNIST(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, torch::data::datasets::MNIST::Mode) + 0x46 (0x7f94e3984ab6 in /home/tensorbook/Downloads/libtorch/lib/libtorch_cpu.so)
frame #4: main + 0x86 (0x55dabc296f4e in ./mnist)
frame #5: __libc_start_main + 0xd5 (0x7f94df72e565 in /lib/x86_64-linux-gnu/libc.so.6)
frame #6: _start + 0x2e (0x55dabc296dee in ./mnist)

@Wyatthy
Copy link

Wyatthy commented Mar 7, 2022

i got this too , did you solve it?

@Wyatthy
Copy link

Wyatthy commented Mar 7, 2022

i got this too , did you solve it?
我解决了,问题的原因在于四个mnist文件没有下载到./data中,你需要使用这一个命令下载下来就好了:
~/projects/pytorch_cpp/cpp/mnist/build$ python3 ../../tools/download_mnist.py -d ./data
then do make
Done

@msaroufim msaroufim added the c++ label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants