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

build from source and get UnicodeDecodeError when importing k2 #1213

Open
samgong opened this issue Jun 19, 2023 · 5 comments
Open

build from source and get UnicodeDecodeError when importing k2 #1213

samgong opened this issue Jun 19, 2023 · 5 comments

Comments

@samgong
Copy link

samgong commented Jun 19, 2023

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
Copy link
Collaborator

Could you first remove the following lines

version.attr("__version__") = std::string(k2::kVersion);
version.attr("git_sha1") = std::string(k2::kGitSha1);
version.attr("git_date") = std::string(k2::kGitDate);
version.attr("cuda_version") = std::string(k2::kCudaVersion);
version.attr("cudnn_version") = std::string(k2::kCudnnVersion);
version.attr("python_version") = std::string(k2::kPythonVersion);
version.attr("build_type") = std::string(k2::kBuildType);
version.attr("os_type") = std::string(k2::kOS);
version.attr("cmake_version") = std::string(k2::kCMakeVersion);
version.attr("gcc_version") = std::string(k2::kGCCVersion);
version.attr("cmake_cuda_flags") = std::string(k2::kCMakeCudaFlags);
version.attr("cmake_cxx_flags") = std::string(k2::kCMakeCxxFlags);
version.attr("torch_version") = std::string(k2::kTorchVersion);
version.attr("torch_cuda_version") = std::string(k2::kTorchCudaVersion);
version.attr("enable_nvtx") = k2::kEnableNvtx;
version.attr("disable_debug") = k2::internal::kDisableDebug;
version.attr("with_cuda") = k2::kWithCuda;

and re-install k2?

@samgong
Copy link
Author

samgong commented Jun 19, 2023

Now it shows
b

@csukuangfj
Copy link
Collaborator

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
Copy link
Author

samgong commented Jun 19, 2023

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

@csukuangfj
Copy link
Collaborator

Does your OS name contain special characters?

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

2 participants