k2-fsa / k2

FSA/FST algorithms, differentiable, with PyTorch compatibility.
https://k2-fsa.github.io/k2
Apache License 2.0
1.1k stars 214 forks source link

build from source and get UnicodeDecodeError when importing k2 #1213

Open samgong opened 1 year ago

samgong commented 1 year ago

Platform: Win10, cuda11.8 and torch 2.01 I build form source by running python setup.py install No error occurs. The build seems to be successful. However, when I import k2 or run python -m k2.version, I get the UnicodeDecodeError. a

csukuangfj commented 1 year ago

Could you first remove the following lines https://github.com/k2-fsa/k2/blob/7ff6d891905ff482364f2d0015867b00d89dd8c7/k2/python/csrc/version.cu#L32-L48 and re-install k2?

samgong commented 1 year ago

Now it shows

b
csukuangfj commented 1 year ago

It seems that it fixes the issue.

Instead of removing those lines, you can change std::string() to "" and re-try.

To find out which line causes the issue, you can change them line by line.

samgong commented 1 year ago

It turns out that the string for "os_type" causes this problem, i.e., line 39.

csukuangfj commented 1 year ago

Does your OS name contain special characters?