LoginSignup
1

More than 5 years have passed since last update.

unexpected end of dataを対処

Posted at

状況

自然言語処理のモデル投入において、
inputDataになにがしかの原因があってエラーがはかれたこと。

model:keras(Tensorflow)
言語:python

エラー

UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 4093-4094: unexpected end of data

原因

unicode sequence が、インプットデータに含まれていた。

対処

今回は、カンマ=,が大量の文字列中に含まれていたので、それを削除したら動いた。

Unicode

マルチバイト文字->日本語の文字列。Ex「ありがとう」
ユニコード文字列->¥uXXXX形式の文字列。Ex「\u3042\u308a\u304c\u3068\u3046」

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1