k2
k2 copied to clipboard
build from source and get UnicodeDecodeError when importing k2
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.
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?
Now it shows
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.
It turns out that the string for "os_type" causes this problem, i.e., line 39.
Does your OS name contain special characters?