examples
                                
                                 examples copied to clipboard
                                
                                    examples copied to clipboard
                            
                            
                            
                        dcgan example ( Pytorch C++ API frontend)
I am trying to build a simple CNN model using libtorch, I am following the tutorial : https://github.com/pytorch/examples/tree/master/cpp/dcgan
I got this error :
hazim@hazim-virtual-machine:~/Documents/dcgan/build$ ./dcgan
terminate called after throwing an instance of 'c10::Error'
what():  Error opening images file at /home/hazim/Downloads/MNIST_DATASET/MNIST_DATASET/train-images-idx3-ubyte
Exception raised from read_images at ../torch/csrc/api/src/data/datasets/mnist.cpp:66 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits
Aborted (core dumped)
I hope someone can help me with this error
Did you solve your problem? @Hazimelhussieny
I ran into this issue and I had two problems.
The first was I put the mnist/ directory at the same level as build/. This means I needed to change the code to go up one directory as such: auto dataset = torch::data::datasets::MNIST("../mnist") Note the two dots in front of /mnist. If you have the mnist directory inside of build/ then don't change this part.
The second issue is that I had outsmarted myself and deleted the .gz files in the mnist directory. Don't do that. Leave it just as the Python script pulled it.
After these, I was able to print out the file contents.