Running error with libtorch C++ front

duola: <p>Hi, guys<br>
I have some error while running the  the DCGAN sample from the official tutorial.</p>
<ol>
<li>I have downloaded the MNIST and saved them in the folder “C:\Users\Administrator\Desktop\MINIST_data”</li>
<li>There is no error while i generate solutions</li>
<li>while i run the project , it shows error in the <em><strong>"torch::data::datasets::MNIST(“C:/Users/Administrator/Desktop/MINIST_data”)".map(torch::data::transforms::Normalize&lt;&gt;(0.5, 0.5)).map(torch::data::transforms::Stack&lt;&gt;());</strong></em>
</li>
<li>The error is “<em><strong>There is an unhandled exception at 0x00007ffcfcd03fb8 (in dcgan. Exe): Microsoft C + + exception: C10:: error, at memory location 0x000000182cf2e360.</strong></em>”</li>
</ol>
<p>Is there something wrong with my path? How should i setup the path?</p>
<p>The following is the code:</p>
<p>auto dataset = torch::data::datasets::MNIST(“C:/Users/Administrator/Desktop/MINIST_data”)<br>
.map(torch::data::transforms::Normalize&lt;&gt;(0.5, 0.5))<br>
.map(torch::data::transforms::Stack&lt;&gt;());<br>
const int64_t batches_per_epoch =<br>
std::ceil(dataset.size().value() / static_cast(kBatchSize));</p>
<p>auto data_loader = torch::data::make_data_loader(<br>
std::move(dataset),<br>
torch::data::DataLoaderOptions().batch_size(kBatchSize).workers(2));</p>
<p>torch::optim::Adam generator_optimizer(<br>
generator-&gt;parameters(), torch::optim::AdamOptions(2e-4).beta1(0.5));<br>
torch::optim::Adam discriminator_optimizer(<br>
discriminator-&gt;parameters(), torch::optim::AdamOptions(2e-4).beta1(0.5));</p>

21fa417e3fb06e56040c: <p>I think, work path or It seems to be a problem with the data file path or dll path</p>

duola: <p>Yes， i have solved the problem. It is really the problem with the file path.</p>

focus: <p>I have the same problem but dont know how to solve it could you be more speceific?</p>

duola: <p>I changed like this:</p>
<p>std::string mnistpath = “C:\Users\Administrator\Desktop\MINIST_data\MNIST\raw”;<br>
torch::data::datasets::MNIST cMnist = torch::data::datasets::MNIST(mnistpath);<br>
auto data_loader = torch::data::make_data_loader(cMnist.map(torch::data::transforms::Stack&lt;&gt;()));</p>

focus: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/4/548e5540b385a96b2c2e194495c0c7c33a63123c.png" data-download-href="https://discuss.pytorch.org/uploads/default/548e5540b385a96b2c2e194495c0c7c33a63123c" title="dataset"><img src="https://discuss.pytorch.org/uploads/default/original/3X/5/4/548e5540b385a96b2c2e194495c0c7c33a63123c.png" alt="dataset" data-base62-sha1="c413nTxpQvKbPr0NUTKp4P6vbY0" width="690" height="114" data-dominant-color="F4F4F4"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">dataset</span><span class="informations">758×126 4.53 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div> .png)<br>
hello my friend, I try just as what you say but it still don’t work, here is the MNIST dataset content of my path and I want to know is it the same as your path? if not, what is the content in your path “C:/Users/Administrator/Desktop/MINIST_data”?</p>

focus: <p>I see that your path is “C:\Users\Administrator\Desktop\MINIST_data\MNIST\raw”, and I am wondering what the file in the “raw” folder？I seems really important to solve my problem.</p>

duola: <p><img src="https://discuss.pytorch.org/uploads/default/original/3X/e/2/e20a661e2b09debf5a592ee2adfe391347940048.png" alt="image" data-base62-sha1="wfEbE7F3WluICcNJdvKNRcB1QsE" width="197" height="194"></p>