我想使用Keras.Net在 C# 中運行經(jīng)過 Python 訓練的 ML 模型,但在 Service Fabric 應用程序中執(zhí)行此操作時遇到問題。我正在主機上運行 Service Fabric 本地群集。我還在這臺主機上安裝了 python。在主機上的 C# 控制臺應用程序中運行 Keras.Net 代碼似乎工作正常,但在主機上的 SF 應用程序中運行相同的代碼時出現(xiàn)以下錯誤:System.AggregateException: One or more errors occurred. (One or more errors occurred. (Unable to load DLL 'python38' or one of its dependencies: The specified module could not be found. (0x8007007E)))---> System.AggregateException: One or more errors occurred. (Unable to load DLL 'python38' or one of its dependencies: The specified module could not be found. (0x8007007E))---> System.DllNotFoundException: Unable to load DLL 'python38' or one of its dependencies: The specified module could not be found. (0x8007007E) at Python.Runtime.Runtime.Py_IsInitialized() at Python.Runtime.Runtime.Initialize(Boolean initSigs) at Python.Runtime.PythonEngine.Initialize(IEnumerable1 args, Boolean setSysArgv, Boolean initSigs) at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs) at Python.Runtime.PythonEngine.Initialize() at Keras.Keras.InstallAndImport(String module) at Keras.Keras.c.b__27_0() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at System.Lazy1.get_Value() at Keras.Keras.get_Instance() at Keras.Models.BaseModel.ModelFromJson(String json_string)這似乎是一個簡單的路徑問題,但我已經(jīng)檢查過環(huán)境在 C# 控制臺應用程序以及 SF 應用程序中保持相同的值(在 Visual Studio 中調(diào)試時)。我在這里采取了錯誤的方法嗎?SF 集群節(jié)點可以訪問主機上的 python 安裝嗎?
添加回答
舉報
0/150
提交
取消