Finetuning VGG11-BN for CIFAR100

Geri: <p>I have loaded the CIFAR100 dataset on this code I found from pytorch to train and test the CIFAR100 dataset using the VGG11-BN network but I get this error.</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/f/6f17d5dfe612239727ad0354f18e5b30ca173533.png" data-download-href="https://discuss.pytorch.org/uploads/default/6f17d5dfe612239727ad0354f18e5b30ca173533" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/6/f/6f17d5dfe612239727ad0354f18e5b30ca173533.png" alt="image" data-base62-sha1="fQM47mmgqzwS1zayaeolKC0Bi3p" width="689" height="175" data-dominant-color="EFEFEF"><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">image</span><span class="informations">1299×330 24.4 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></p>
<p>The rest of the error and code related to train model where the error comes from will be in the comments</p>

Geri: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/5/955aa6c7d4bdf8d3b9c5111ab793f603fec7b99f.png" data-download-href="https://discuss.pytorch.org/uploads/default/955aa6c7d4bdf8d3b9c5111ab793f603fec7b99f" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/5/955aa6c7d4bdf8d3b9c5111ab793f603fec7b99f_2_690x437.png" alt="image" data-base62-sha1="ljfmvpMdY017k7TdTXkCBDmv1V5" width="690" height="437" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/5/955aa6c7d4bdf8d3b9c5111ab793f603fec7b99f_2_690x437.png, https://discuss.pytorch.org/uploads/default/optimized/3X/9/5/955aa6c7d4bdf8d3b9c5111ab793f603fec7b99f_2_1035x655.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/9/5/955aa6c7d4bdf8d3b9c5111ab793f603fec7b99f.png 2x" data-dominant-color="F7F8F8"><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">image</span><span class="informations">1264×802 62.7 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></p>

Geri: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/1/11458699ce265a9924eb0a0eb9cff6ec2e06109a.png" data-download-href="https://discuss.pytorch.org/uploads/default/11458699ce265a9924eb0a0eb9cff6ec2e06109a" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/1/1/11458699ce265a9924eb0a0eb9cff6ec2e06109a.png" alt="image" data-base62-sha1="2sN4FsYxHqTE74ISa9ce2tTUOhA" width="690" height="474" data-dominant-color="F1F2F2"><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">image</span><span class="informations">1177×810 49.5 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></p>

ptrblck: <p>Based on the error message you are trying to return <code>PIL.Image</code>s instead of tensors (or numpy arrays) and the <code>DataLoader</code> will thus raise the error.<br>
Have a look at <a href="https://pytorch.org/tutorials/beginner/basics/data_tutorial.html">the data loading tutorial</a>, which shows how to transform the images to tensors.</p>
<p>PS: you can post code snippets by wrapping them into three backticks ```.</p>