Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch08/train.pyでModuleNotFoundError #19

Open
segavvy opened this issue Feb 6, 2021 · 0 comments
Open

ch08/train.pyでModuleNotFoundError #19

segavvy opened this issue Feb 6, 2021 · 0 comments

Comments

@segavvy
Copy link

segavvy commented Feb 6, 2021

ch08/train.pyでModuleNotFoundErrorが起きます。

Traceback (most recent call last):
  File "/Users/segavvy/Documents/deep-learning-from-scratch-2/ch08/train.py", line 12, in <module>
    from ch07.peeky_seq2seq import PeekySeq2seq
  File "../ch07/peeky_seq2seq.py", line 5, in <module>
    from seq2seq import Seq2seq, Encoder
ModuleNotFoundError: No module named 'seq2seq'

インポート対象のch07/peeky_seq2seq.pyは、中でさらに同じ場所にあるseq2seq.pyをインポートしようとしますが、ch07にはパスが通っていないためch07内を探さないことが原因のようです。

ch08/train.pyの先頭部分に sys.path.append('../ch07’) を追加することで回避できます。(ベストな直し方かどうかはわかりませんが)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant