TimDettmers / ConvE

Convolutional 2D Knowledge Graph Embeddings resources
MIT License
674 stars 163 forks source link

prcocess dataset YAG03-10 ERROR #46

Closed 1earninging closed 3 years ago

1earninging commented 5 years ago

Processing dataset YAGO3-10 Traceback (most recent call last): File "wrangle_KG.py", line 34, in data = f.readlines() + data File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 188: ordinal not in range(128)

TimDettmers commented 5 years ago

I think this relates to your system-wide ASCII settings. You can try prepending the following to main.py as a temporary solution:

import sys
# sys.setdefaultencoding() does not exist, here!
reload(sys)  # Reload does the trick!
sys.setdefaultencoding('UTF8')