title: Errno 13 while Transfer-learning Inception v3
body: <p>So I just learned python a couple of weeks ago, and I'm new to tensorflow. But I need to fine-tune the inception model. While trying to follow some tutorials, when I finally started to see some light, I got this horrible error that I can´t get rid of. Here is the part of the code that has the error:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  train_dir=r'C:\tf_files'
  
  image_paths=train_dir
  
  images = [plt.imread(train_dir) for path in image_paths]
  
  def plot_images(images, cls_true, cls_pred=None, smooth=True):
      assert len(images) == len(cls_true)
  
      # Create figure with sub-plots.
      fig, axes = plt.subplots(3, 3)
  
      # Adjust vertical spacing.
      if cls_pred is None:
          hspace = 0.3
      else:
          hspace = 0.6
      fig.subplots_adjust(hspace=hspace, wspace=0.3)
  
      # Interpolation type.
      if smooth:
          interpolation = 'spline16'
      else:
          interpolation = 'nearest'
  
      for i, ax in enumerate(axes.flat):
          # There may be less than 9 images, ensure it doesn't crash.
          if i &lt; len(images):
              # Plot image.
              ax.imshow(images[i],
                        interpolation=interpolation)
  
              # Name of the true class.
              cls_true_name = class_names[cls_true[i]]
  
              # Show true and predicted classes.
              if cls_pred is None:
                  xlabel = "True: {0}".format(cls_true_name)
              else:
                  # Name of the predicted class.
                  cls_pred_name = class_names[cls_pred[i]]
  
                  xlabel = "True: {0}\nPred: {1}".format(cls_true_name, cls_pred_name)
  
              # Show the classes as the label on the x-axis.
              ax.set_xlabel(xlabel)
  
          # Remove ticks from the plot.
          ax.set_xticks([])
          ax.set_yticks([])
  
      # Ensure the plot is shown correctly with multiple plots
      # in a single Notebook cell.
      plt.show()
  </code></pre>
  
  <p>and this is what the terminal spits:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Shangai/PycharmProjects/PSai/Testing.py", line 14, in &lt;module&gt;
      images = [plt.imread(train_dir) for path in image_paths]
    File "C:/Users/Shangai/PycharmProjects/PSai/Testing.py", line 14, in &lt;listcomp&gt;
      images = [plt.imread(train_dir) for path in image_paths]
    File "C:\Users\Shangai\AppData\Local\conda\conda\envs\PSAI\lib\site-packages\matplotlib\pyplot.py", line 2152, in imread
      return matplotlib.image.imread(fname, format)
    File "C:\Users\Shangai\AppData\Local\conda\conda\envs\PSAI\lib\site-packages\matplotlib\image.py", line 1359, in imread
      with Image.open(fname) as image:
    File "C:\Users\Shangai\AppData\Local\conda\conda\envs\PSAI\lib\site-packages\PIL\Image.py", line 2609, in open
      fp = builtins.open(filename, "rb")
  PermissionError: [Errno 13] Permission denied: 'C:\\tf_files'
  </code></pre>
  
  <p>I basically need a way to make an image an array, but I can´t figure it out.
  Any help would be appreciated, thank you so much. Peace!</p>
  
  <p>-I'm using pycharm with an anaconda environment-</p>