title: pytorch: get number of classes given an ImageFolder dataset
body: <p>If I have a dataset like:</p>
  
  <pre><code>image_datasets['train'] = datasets.ImageFolder(train_dir, transform=train_transforms)
  </code></pre>
  
  <p>How do I determine programatically the number of classes or unique labels in the dataset?</p>