Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编码错误 #6

Open
signupbook opened this issue Jan 19, 2023 · 3 comments
Open

编码错误 #6

signupbook opened this issue Jan 19, 2023 · 3 comments

Comments

@signupbook
Copy link

C:\Users\Jason\anaconda3\envs\vocal\lib\site-packages\numpy_distributor_init.py:32: UserWarning: loaded more than 1 DLL from .libs:
C:\Users\Jason\anaconda3\envs\vocal\lib\site-packages\numpy.libs\libopenblas.QVLO2T66WEPI7JZ63PS3HMOHFEY472BC.gfortran-win_amd64.dll
C:\Users\Jason\anaconda3\envs\vocal\lib\site-packages\numpy.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll
stacklevel=1)
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
filelists/train.txt ----start emotion extract-------
Traceback (most recent call last):
File "emotion_extract.py", line 133, in
for idx, line in enumerate(f.readlines(),encoding = "utf-8"):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 20: illegal multibyte sequence
请问txt文件已经改为utf-8编码了为什么仍然报错?
求解

@SixInternet
Copy link

C:\Users\Jason\anaconda3\envs\vocal\lib\site-packages\numpy_distributor_init.py:32: UserWarning: loaded more than 1 DLL from .libs: C:\Users\Jason\anaconda3\envs\vocal\lib\site-packages\numpy.libs\libopenblas.QVLO2T66WEPI7JZ63PS3HMOHFEY472BC.gfortran-win_amd64.dll C:\Users\Jason\anaconda3\envs\vocal\lib\site-packages\numpy.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll stacklevel=1) Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. filelists/train.txt ----start emotion extract------- Traceback (most recent call last): File "emotion_extract.py", line 133, in for idx, line in enumerate(f.readlines(),encoding = "utf-8"): UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 20: illegal multibyte sequence 请问txt文件已经改为utf-8编码了为什么仍然报错? 求解

emmm, encoding应该是open函数的参数吧,不是enumerate的吧,我在open函数里面加上encoding参数就可以了

@ttkrpink
Copy link

遇到同样问题,哪个文件里的open函数需要改?

@ecchiaru114514
Copy link

遇到同样问题,哪个文件里的open函数需要改?

修改emotion_extract.py中的第132行为
with open(filelist,'r',encoding='UTF-8') as f:
即可。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants