Pinlong-Zhao / SDGCN

Modeling Sentiment Dependencies with Graph Convolutional Networks for Aspect-level Sentiment Classification
53 stars 24 forks source link

UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 1724: illegal multibyte sequence #13

Open superlgg opened 2 years ago

superlgg commented 2 years ago

报错如下: Traceback (most recent call last): File "D:/project/SDGCN-master/run_glove.py", line 345, in Train, Test, word_embedding = preprocess() File "D:/project/SDGCN-master/run_glove.py", line 101, in preprocess word_id_mapping, w2v = data_helpers.load_w2v(FLAGS.embedding_file_path, FLAGS.word_embedding_dim) File "D:\project\SDGCN-master\data_helpers.py", line 127, in load_w2v for line in fp: UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 1724: illegal multibyte sequence 想请问如何修改,非常感谢

superlgg commented 2 years ago

已经解决,在data_helpers里加入了 fp = open(w2v_file,'r', encoding='UTF-8')