问题
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-node - 2.0.0 electron - 1.8.8
When I try to load the tfjs module using:
const tf = require('@tensorflow/tfjs');
I get the following error:
I have looked everywhere but can't seem to find anything relevant for this error.
Any help would be much appreciated.
回答1:
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.
Thanks to @edkeveked for all his help.
The solution is to
- Create a new electron project
- Install electron followed by @tensorflow/tfjs
- Install all other required modules
- Move the node_modules directory from this to my original app directoy.
Hope this helps someone else facing this issue.
来源:https://stackoverflow.com/questions/62213645/error-loading-tensorflowjs-in-electron-app-nodejs