k2 icon indicating copy to clipboard operation
k2 copied to clipboard

build from source and get UnicodeDecodeError when importing k2

Open samgong opened this issue 1 year ago • 5 comments

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

samgong avatar Jun 19 '23 08:06 samgong

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?

csukuangfj avatar Jun 19 '23 08:06 csukuangfj

Now it shows b

samgong avatar Jun 19 '23 09:06 samgong

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.

csukuangfj avatar Jun 19 '23 09:06 csukuangfj

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

samgong avatar Jun 19 '23 09:06 samgong

Does your OS name contain special characters?

csukuangfj avatar Jun 19 '23 10:06 csukuangfj