Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 views
in Technique[技术] by (71.8m points)

javascript - TensorflowJS backend CPU kernel undefined is already registered

I am loading the TensorFlowJS library and backend GPU with these script tags:

<script defer src="https://unpkg.com/@tensorflow/[email protected]/dist/tf-core.js"></script>
<script defer src="https://unpkg.com/@tensorflow/[email protected]/dist/tf-converter.js"></script>
<script defer src="https://unpkg.com/@tensorflow/[email protected]/dist/tf-backend-webgl.js"></script>

This works, but it gives me this warning in the console:

Your application contains ops that are small enough to be executed on the CPU backend, however the CPU backend cannot be found. Consider importing the CPU backend (@tensorflow/tfjs-backend-cpu) for better performance.

BUT when I load the backend CPU with this tag:

<script defer src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu"></script>

I get these errors:

kernel_registry.ts:142 The kernel 'undefined' for backend 'cpu' is already registered

And

backend.ts:665 Uncaught (in promise) Error: 'realDivide' not yet implemented or not found in the registry. 
Did you forget to import the kernel?
    at notYetImplemented (backend.ts:665)

If I load both GPU and CPU, I only get the kernel undefined is already registered warning.

Some other posts here on SO and GitHub say that some libraries are probably loaded twice? But I can't leave out any of these script tags...

question from:https://stackoverflow.com/questions/65852147/tensorflowjs-backend-cpu-kernel-undefined-is-already-registered

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...