The example code of DDPM works well in python. But after I convert it into tensorflowjs model, and run it in web browser, this line failed with error.
tf.einsum("bhwHW,bHWc->bhwc", attn_score, v)
Error: Found duplicate axes in input component bhwhw. Support for duplicate axes in input is not implemented yet.
at Object.K_ [as decodeEinsumEquation] (einsum_util.js:95:13)
at Object.kernelFunc (Einsum.ts:36:20)
at n (engine.js:647:22)
at engine.js:713:23
at t.scopedRun (engine.js:480:19)
at t.runKernelFunc (engine.js:709:10)
at t.runKernel (engine.js:554:17)
at einsum_ (einsum.js:107:17)
at Object.einsum__op [as einsum] (operation.js:51:22)
at matrices_executor.js:43:23
I doubt it is because incompability of tensorflowjs. Tried to rewrite this line without using einstein notation but always fails.
UPDATE:
This is a bug in tfjs, I have reported here: https://github.com/tensorflow/tfjs/issues/7404