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

这个代码能被修改成PC版的吗? #8

Open
Chenpuh opened this issue Sep 9, 2020 · 0 comments
Open

这个代码能被修改成PC版的吗? #8

Chenpuh opened this issue Sep 9, 2020 · 0 comments

Comments

@Chenpuh
Copy link

Chenpuh commented Sep 9, 2020

你好。这个代码只能在Android上使用吗?我尝试修改成PC版的,并使用eclipse编译代码,在加载模型时产生了下面的错误:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Exception in thread "main" java.lang.NoClassDefFoundError: android/util/Log
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.prepareNativeRuntime(TensorFlowInferenceInterface.java:505)
at org.tensorflow.contrib.android.TensorFlowInferenceInterface.(TensorFlowInferenceInterface.java:124)
at speechRecognition.main.main(main.java:40)
Caused by: java.lang.ClassNotFoundException: android.util.Log
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more

加载模型代码如下:
TensorFlowInferenceInterface inferenceInterface;
InputStream is = new FileInputStream(MODEL_FILENAME);
inferenceInterface = new TensorFlowInferenceInterface(is);

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

1 participant