Error occurs when training spark word2vec

Hi,

I’m using org.deeplearning4j.spark.models.embeddings.word2vec.Word2Vec to train word2vec, and the following errors occur

Exception in thread “main” java.lang.IllegalStateException: Cannot perform in-place operation “addi”: result array shape does not match the broadcast operation output shape: [200].addi([1, 200]) != [200].
In-place operations like x.addi(y) can only be performed when x and y have the same shape, or x and y are broadcastable with x.shape() == broadcastShape(x,y)
at org.nd4j.linalg.api.shape.Shape.assertBroadcastable(Shape.java:283)
at org.nd4j.linalg.api.ndarray.BaseNDArray.addi(BaseNDArray.java:3251)
at org.nd4j.linalg.api.ndarray.BaseNDArray.addi(BaseNDArray.java:3245)
at org.deeplearning4j.spark.models.embeddings.word2vec.Word2Vec.train(Word2Vec.java:222)
at dl4jword2vec.Fun.main(Fun.java:24)

Here is my testing program Plain Text code - 26 lines - codepad, and the POM.xml is here Plain Text code - 60 lines - codepad. I’m not sure if I do anything wrong. The training file “/tmp/test” is just 100 lines of “a b c d e f g h I j k”.

Thank you all in advance.

That appears to be a bug. Not many people are still using Word2Vec, and fewer still are using it on Spark.

Please report this bug on github: Issues · eclipse/deeplearning4j · GitHub

Thank you! Will report it.