IBM / Grapher

Code that implements efficient knowledge graph extraction from the textual descriptions
Apache License 2.0
142 stars 32 forks source link

Encoding in dataset.py:61 json.load() #4

Closed dennismenze closed 1 year ago

dennismenze commented 1 year ago

When starting training, I got the following error:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 238339: character maps to <undefined>

By adding an encoding parameter, the error was resolved:

D = json.load(open(os.path.join(self.output_path, f'{split}.json'), encoding="utf-8"))

imelnyk commented 1 year ago

Although I did not have this encoding issue on my end, it is great that this simple fix worked for you. Thanks for posting it!