About downloading mnist in chapter 3 of deep learning starting from the bottom

Asked 2 years ago, Updated 2 years ago, 64 views

Hello? We are currently studying dimneoning to start to the bottom of the three pages. 책에서 나온 그대로 했는데도 아래와 같은 오류가 발생하는데 이유가 무엇인지 알수 있을까요?

import sys, os
sys.path.append(os.pardir)
from dataset.mnist import load_mnist
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-25-82f82e240db8> in <module>
      3 import sys, os
      4 sys.path.append(os.pardir)
----> 5 from dataset.mnist import load_mnist

ModuleNotFoundError: No module named 'dataset'

deep-learning python

2022-09-21 16:59

1 Answers

The dataset directory should be under the parent directory of the script file that you want to run. mnist.py must also exist under dataset.

https://github.com/WegraLee/deep-learning-from-scratch

Take the source of the link as a download zip, release it, and run the example script in the ch03 folder first, make sure it works, look at the directory structure, and make your own.

When import, I found it in the path of sys.path and added the parent directory path to sys.path. Because dataset is in the parent path of the script file.


2022-09-21 16:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.