ml-models icon indicating copy to clipboard operation
ml-models copied to clipboard

DeepGL Invalid shape error

Open tomasonjo opened this issue 6 years ago • 10 comments

Load data.

:play movies

Run algorithm:

CALL embedding.deepgl("Person" ,null)

I get an error:

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure embedding.deepgl: Caused by: org.nd4j.linalg.exception.ND4JIllegalStateException: Invalid shape: Requested INDArray shape [0, 54] contains dimension size values < 1 (all dimensions must be 1 or more)

tomasonjo avatar Oct 06 '18 07:10 tomasonjo

This happens if it can't build a graph between the Nodes/Rels specified. With the default graph Person nodes are not connected to Person nodes so we get that error. We should make it throw a better exception.

mneedham avatar Oct 06 '18 09:10 mneedham

I have place the follow the step provided in github to couple deepgl,but when I call embedding.deepgl it say there is no such procedure @mneedham @tomasonjo

Tomposon avatar Oct 13 '18 13:10 Tomposon

Did you add in the Neo4j.conf file

dbms.security.procedures.whitelist= embedding.*
dbms.security.procedures.unrestricted= embedding.*

tomasonjo avatar Oct 13 '18 17:10 tomasonjo

I add dbms.security.procedures.whitelist=regression., embedding. in the Neo4j.conf file.Procedure regression can work well,but embedding can't @tomasonjo

Tomposon avatar Oct 14 '18 03:10 Tomposon

@tomasonjo I have try it many times.But it is sad that regression model can work but embedding can't.How did you install this?

Tomposon avatar Oct 14 '18 04:10 Tomposon

I think your file should read like this:

dbms.security.procedures.whitelist= embedding.*,regression.*
dbms.security.procedures.unrestricted= embedding.*,regression.*

If you have that and regression is working and embedding isn't...then maybe you have an earlier release when embedding wasn't there yet?

mneedham avatar Oct 14 '18 06:10 mneedham

I have try your advice,but the result is the same as the previous result that regression can but embedding cannot.My installed neo4j is the latest version neo4j-community-3.4.8.Could you tell me why.I really want to use the deepgl to do network representation learning. @mneedham

Tomposon avatar Oct 14 '18 07:10 Tomposon

@mneedham I downloaded 3rd Release: DeepGL.It should have include the embedding.I don't know why it can't work well

Tomposon avatar Oct 14 '18 08:10 Tomposon

@Tomposon Maybe try without spaces for those config settings? I have it running like this:

dbms.security.procedures.unrestricted=algo.*,embedding.*
dbms.security.procedures.whitelist=embedding.*

mneedham avatar Oct 18 '18 10:10 mneedham

Hi, I face same issue. I have the latest neo4j-community-3.5.5 and the latest neo4j-ml-models-1.0.3.jar. Have config neo4j.conf properly reading the jar and I can execute embedding. I have created movie graph and tried:

CALL embedding.deepgl("Person" ,null)

Go the error: Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure embedding.deepgl: Caused by: org.nd4j.linalg.exception.ND4JIllegalStateException: Invalid shape: Requested INDArray shape [0, 54] contains dimension size values < 1 (all dimensions must be 1 or more)

The graph structure does not link Person to Person directly but via Movies.

EDIT: I recreated whole Graph from scratch and run the following:

CALL embedding.deepgl("Person" ,'ACTED_IN', {nodeFeatures: ["Movie","Person"]}) CALL embedding.deepgl("Person" ,'ACTED_IN', {nodeFeatures: ["Movie"]})

Same error. I wonder if my understading of DeepWalk is correct then. I assumed that it was not required for nodes to be in direct neighbourhood to derive embbedding for them. Is that correct?

mgalusza avatar Aug 30 '19 10:08 mgalusza