v0.3下载地址:https://github.com/Syn-McJ/TFClassify-Unity
https://s3.amazonaws.com/unity-ml-agents/0.3/TFSharpPlugin.unitypackage
v0.4下载地址:https://s3.amazonaws.com/unity-ml-agents/0.4/TFSharpPlugin.unitypackage
v0.5下载地址:https://s3.amazonaws.com/unity-ml-agents/0.5/TFSharpPlugin.unitypackage
1.出现错误:Assets\TensorFlow\Detector.cs(59,9): error CS0103: The name ‘TensorFlowSharp’ does not exist in the current context`
Code: "#if UNITY_ANDROID
TensorFlowSharp.Android.NativeBinding.Init ();
#endif"
Assets\TensorFlow\Classifier.cs(31,9): error CS0103: The name 'TensorFlowSharp' does not exist in the current context
Code: "#if UNITY_ANDROID
TensorFlowSharp.Android.NativeBinding.Init ();
#endif"`
解决方法:
- (1)将插件换为更低一级的版本如v0.3试一试
- (2)instead of
#if UNITY_ANDROID
change it to#if (UNITY_ANDROID && !UNITY_EDITOR)
2.出现错误:Unloading broken assembly Assets/ML-Agents/Plugins/Android/TensorFlowSharp.Android.dll, this assembly can cause crashes in the runtime
解决方法:
- 我认为这是导入设置问题。 只需选择TensorFlowSharp.Android.dll并取消选中编辑器作为此插件(以及除Android外的所有其他产品)的平台即可。 这使错误消失。
3.出现错误:
Android SDK is outdated SDK Tools version 25.2.5<26.1.1
解决方法:
使用Android Studio更新
https://www.androiddevtools.cn/下载点击首页的configeration
左侧找到Android SDK
安装成功