Where the data would be save when I use torchvision.datasets

username: isalirezag
cooked: <p>I am using pytorch tutorial for training a classifier (<a href="http://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#" rel="nofollow noopener">http://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#</a>)</p>
<p>When I download the CIFAR10 via:<br>
trainset = torchvision.datasets.CIFAR10(root=’./data’, train=True,<br>
download=True, transform=transform)</p>
<p>Where exactly my the data would be saved? I cannot find any data folder anywhere…</p>

username: tom
cooked: <p>Hi</p>
<p>it is right in the directory where you run your program. If you want to have a fixed path, you need to specify it yourself, eg using os.path.expanduser.</p>
<p>Best regards</p>
<p>Thomas</p>

username: isalirezag
cooked: <p>Thank you for your answer.<br>
I have a follow up question.<br>
So I use the following code to define training and testing sets.</p>
<pre><code>trainset = torchvision.datasets.CIFAR10(root='./data', train=True,  download=True, transform=transform)
trainloader = torch.utils.data.DataLoader(trainset, batch_size=4, shuffle=True, num_workers=2)

testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=True, transform=transform)
testloader = torch.utils.data.DataLoader(testset, batch_size=4, shuffle=False, num_workers=2)
</code></pre>
<p>My expectation was that by going to data folder, I see training and testing folders and images inside of them, but what I saw was just 8 files with these names: <strong>batches.meta, data_batch_1, data_batch_2, data_batch_3, data_batch_4,  data_batch_5, readme.html, and test_batch</strong>.</p>
<p>Can you please tell me what are they and how they are gonna be used? which one is for training and which one is for testing?</p>
<p>Thanks  a lot in advance</p>

username: tom
cooked: <p>Hello.</p>
<p>data_batch_* for training<br>
test_batch for test</p>
<p>You can look at the details of how they are used here:<br>
<aside class="onebox githubblob">
  <header class="source">
      <a href="https://github.com/pytorch/vision/blob/master/torchvision/datasets/cifar.py#L38-L48" target="_blank" rel="nofollow noopener">github.com</a>
  </header>
  <article class="onebox-body">
    <h4><a href="https://github.com/pytorch/vision/blob/master/torchvision/datasets/cifar.py#L38-L48" target="_blank" rel="nofollow noopener">pytorch/vision/blob/master/torchvision/datasets/cifar.py#L38-L48</a></h4>
<pre class="onebox"><code class="lang-py"><ol class="start lines" start="38" style="counter-reset: li-counter 37 ;">
<li>train_list = [</li>
<li>    ['data_batch_1', 'c99cafc152244af753f735de768cd75f'],</li>
<li>    ['data_batch_2', 'd4bba439e000b95fd0a9bffe97cbabec'],</li>
<li>    ['data_batch_3', '54ebc095f3ab1f0389bbae665268c751'],</li>
<li>    ['data_batch_4', '634d18415352ddfa80567beed471001a'],</li>
<li>    ['data_batch_5', '482c414d41f54cd18b22e5b47cb7c3cb'],</li>
<li>]</li>
<li>
</li>
<li>test_list = [</li>
<li>    ['test_batch', '40351d587109b95175f43aff81a1287e'],</li>
<li>]</li>
</ol></code></pre>


  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
</p>
<p>Best regards</p>
<p>Thomas</p>

username: kartikpodugu
cooked: <p>Thanks Thomas. That was very simple.<br>
I thought it will download to torch installation directory.</p>