golbin / TensorFlow-Tutorials

텐서플로우를 기초부터 응용까지 단계별로 연습할 수 있는 소스 코드를 제공합니다
2.13k stars 1k forks source link

Seq2Seq 코드 문제 #24

Closed 1nsunym closed 6 years ago

1nsunym commented 6 years ago

Seq2Seq 파일 구동 시 다음과 같은 에러가 발생합니다.

Traceback (most recent call last):
  File "test.py", line 68, in <module>
    input_batch, output_batch, target_batch = make_batch(seq_data)
  File "test.py", line 25, in make_batch
    output_batch.append(np.eye(dic_len)[output])
IndexError: index 62 is out of bounds for axis 0 with size 48

Tensorflow version 1.4.0을 사용하고 있습니다.

golbin commented 6 years ago

test.py 라는 파일은 없는데요. 원본 스크립트도 실행시 문제가 있는지, 혹시 뭔가를 수정하신건 아닌지 확인 부탁드립니다.

1nsunym commented 6 years ago

위 파일에서는 comment만 지우고 돌렸구요, 혹시나 해서 새로 받아서 돌렸습니다.

Traceback (most recent call last):
  File "03 - Seq2Seq.py", line 101, in <module>
    input_batch, output_batch, target_batch = make_batch(seq_data)
  File "03 - Seq2Seq.py", line 37, in make_batch
    output_batch.append(np.eye(dic_len)[output])
IndexError: index 62 is out of bounds for axis 0 with size 48

원본파일과의 다른점은 첫줄에 아래와 같은 utf-8 인코딩 관련 라인을 삽입했습니다.

 # -*- coding: utf-8 -*-
golbin commented 6 years ago

파이썬 버전 3.5 이상, 텐서플로 버전 1.2 이상이 맞나요?

1nsunym commented 6 years ago

더 낮은 버젼의 파이썬을 쓰고 있었습니다 ㅜㅜ 죄송합니다. 책 잘 보고 있습니다.