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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…