UnicodeDecodeError: 'gbk' codec can't decode byte 0x8c in position 27: illegal multibyte sequence
Created by: livingbody
1.代码
`import paddlehub as hub
module = hub.Module(name="ernie_gen_couplet")
test_texts = ["大江向东我向西"] test_texts results = module.generate(texts=test_texts, use_gpu=True, beam_width=5) for result in results: print(result) `
2.报错
[2020-08-10 19:37:22,252] [ INFO] - Installing ernie_gen_couplet module [2020-08-10 19:37:22,578] [ INFO] - Module ernie_gen_couplet already installed in C:\Users\Administrator\.paddlehub\modules\ernie_gen_couplet Traceback (most recent call last): File "C:/Users/Administrator/PycharmProjects/cbowtest/test3.py", line 3, in <module> module = hub.Module(name="ernie_gen_couplet") File "C:\Anaconda3\envs\paddlegpu\lib\site-packages\paddlehub\module\module.py", line 102, in __new__ name=name, version=version, **kwargs) File "C:\Anaconda3\envs\paddlegpu\lib\site-packages\paddlehub\module\module.py", line 178, in init_with_name return cls.init_with_directory(directory=module_dir[0], **kwargs) File "C:\Anaconda3\envs\paddlegpu\lib\site-packages\paddlehub\module\module.py", line 200, in init_with_directory user_module = _item(directory=directory, **kwargs) File "C:\Anaconda3\envs\paddlegpu\lib\site-packages\paddlehub\module\module.py", line 146, in __init__ self._initialize(**kwargs) File "C:\Users\Administrator\.paddlehub\modules\ernie_gen_couplet\module.py", line 59, in _initialize for i, j in enumerate(ernie_vocab_file.readlines()) UnicodeDecodeError: 'gbk' codec can't decode byte 0x8c in position 27: illegal multibyte sequence