问题描述
我正在尝试使用tensorflow js在我的电子应用程序中使用tensorflow.
I am trying to get tensorflow working in my electron app using tensorflow js.
以下是各个版本的详细信息:
Here are the details of the various versions:
Nodejs:v14.4.0@ tensorflow/tfjs-2.0.0@ tensorflow/tfjs节点-2.0.0电子-1.8.8
Nodejs: v14.4.0@tensorflow/tfjs - 2.0.0@tensorflow/tfjs-node - 2.0.0electron - 1.8.8
当我尝试使用以下方法加载tfjs模块时:
When I try to load the tfjs module using:
我收到以下错误:
我到处都看过,但似乎找不到与此错误相关的任何内容.
I have looked everywhere but can't seem to find anything relevant for this error.
任何帮助将不胜感激.
推荐答案
解决方案
问题似乎是相互竞争的图书馆之一.尽管我不知道确切的库,但找到了一种解决方法,其中涉及先安装@ tensorflow/tfjs,然后再安装所有其他库.
SOLUTION
The issue seems to be one of competing libraries. Although I don't know exact which library, found a workaround which involved installing @tensorflow/tfjs first followed by all other libraries.
感谢@edkeveked的所有帮助.
Thanks to @edkeveked for all his help.
解决方案是
- 创建一个新的电子项目
- 安装电子,然后安装@ tensorflow/tfjs
- 安装所有其他必需的模块
- 将node_modules目录从该目录移动到我的原始应用程序目录中.
希望这可以帮助其他面临此问题的人.
Hope this helps someone else facing this issue.
这篇关于在Electron App(Nodejs)中加载TensorflowJS时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!