Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running in exception "cannot create Tensors with a 0 dimension: {}" #5

Closed
rothkoe opened this issue Oct 3, 2017 · 6 comments
Closed

Comments

@rothkoe
Copy link

rothkoe commented Oct 3, 2017

Hi, .. running into java exception

2017-10-03 22:35:06,147 ERROR [Timer-Driven Process Thread-1] c.d.p.process.TensorFlowProcessor TensorFlowProcessor[id=1f395b44-8ece-3009-d186-a257844e2506] Failed to process session due to org.apache.nifi.processor.exception.ProcessException: org.apache.nifi.processor.exception.ProcessException: java.lang.IllegalArgumentException: cannot create Tensors with a 0 dimension: {}

Any idea what this causes?

using the 2.1 version

@tspannhw
Copy link
Owner

tspannhw commented Oct 4, 2017

were all the parameters set? the 2.1 version has different parameters. you need to delete the old processor and drop on a new one. make sure the model directory is readable

@simonellistonball
Copy link
Collaborator

Note that I also changed the expected name of model files in the modeldir, and hit this as a result. Per the README, we now assume the model is called graph.pb and the labels are in label.txt

@simonellistonball
Copy link
Collaborator

One other note... my bad... worked in test, not properly in a proper multi-threaded nifi... I've fixed up the approach to flowFile content reading to be more robust to race conditions, and seems to work for me now in a prod setting. Please update your build from HEAD and try again.

@rothkoe
Copy link
Author

rothkoe commented Oct 4, 2017

... parameters have been adjusted

Payload from the ListFile processor to the inbound queue to tensorflow processor looks fine
FlowFile Details UUID 571ff52e-b643-4dd9-a551-f71da3757210, Filename squirrelshirt.jpg,File Size 0.00 bytes

But zero byte found in logs/nifi-app.log loading the graph.pb (below)?

2017-10-03 22:23:58,259 INFO [Timer-Driven Process Thread-10] c.d.processors.process.TensorFlowService getInception: 0 bytes /home/nifi/demo3/models/graph.pb

the nifi-bootstrapp.log shows

2017-10-04 08:52:26,772 ERROR [NiFi logging handler] org.apache.nifi.StdErr 2017-10-04 08:52:26.772827: W tensorflow/core/framework/op_def_util.cc:332] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().

It seems the installed tensorflow framework mismatches with the version of the loaded models /graph.pb.

What do you think?

@rothkoe
Copy link
Author

rothkoe commented Oct 4, 2017

clean install of tensorflow 1.3.0 and the debug message helped to fix it

2017-10-04 11:13:23,933 INFO [Timer-Driven Process Thread-6] c.d.p.process.TensorFlowProcessor TensorFlowProcessor[id=e65b15cb-015e-1000-ca5e-3d043cbb8088] read 0 bytes from incoming file

GetFile processor works ... not ListFile (!)

Thanks

@rothkoe rothkoe closed this as completed Oct 4, 2017
@simonellistonball
Copy link
Collaborator

Yep, my changes meant we now read the content from the FlowFile, not from an external file, so the best way to do it would be ListFile->FetchFile->TensorFlowProcessor, or as you say GetFile-> TensorFlowProcessor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants