Skip to content

Incorrect file path in lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb #569

@luca-bruni

Description

@luca-bruni

Running the 21st cell in Perceptron.ipynb after opening Jupyter Notebook via the cloned repository, I receive the following:

 1 # If you are not running this notebook from a cloned repository, you may need to grab the binary dataset file first
      2 # !wget https://github.com/microsoft/AI-For-Beginners/raw/main/data/mnist.pkl.gz?raw=true
      3 # In this case correct the link to the dataset below as well.
----> 5 with gzip.open('../../data/mnist.pkl.gz', 'rb') as mnist_pickle:
      6     MNIST = pickle.load(mnist_pickle, encoding='latin1')

File ~\miniconda3\envs\ai4beg\Lib\gzip.py:65, in open(filename, mode, compresslevel, encoding, errors, newline)
     63 gz_mode = mode.replace("t", "")
     64 if isinstance(filename, (str, bytes, os.PathLike)):
---> 65     binary_file = GzipFile(filename, gz_mode, compresslevel)
     66 elif hasattr(filename, "read") or hasattr(filename, "write"):
     67     binary_file = GzipFile(None, gz_mode, compresslevel, filename)

File ~\miniconda3\envs\ai4beg\Lib\gzip.py:201, in GzipFile.__init__(self, filename, mode, compresslevel, fileobj, mtime)
    199 try:
    200     if fileobj is None:
--> 201         fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
    202     if filename is None:
    203         filename = getattr(fileobj, 'name', '')

FileNotFoundError: [Errno 2] No such file or directory: '../../data/mnist.pkl.gz'

https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb?short_path=cbcbc45#L765

Should be fixed by prepending an additional ..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions