Run parsey from subprocess
I'm trying to run parsey mcparseface from a subprocess wait for it to complete and then run some more code. I get different results when running Popen vs call and I'm wondering why this is.
This works. process = subprocess.Popen("./syntaxnet/demo.sh", cwd="/home/kahless/models/syntaxnet")
This does not. process = subprocess.call("./syntaxnet/demo.sh", cwd="/home/kahless/models/syntaxnet") Both execute without python throwing any errors but when running .call parsey does not complete correctly. This also happens when using .wait() or .communicate() with Popen. What I'm trying to do is pause the execution of my code until parsey finishes. Not sure whats going on here.
When I say that parsey does not complete correctly I mean I am getting a different end result from running the demo.sh file. Here are the different outputs.
When things work correctly
INFO:tensorflow:Processed 10 documents INFO:tensorflow:Total processed documents: 10 INFO:tensorflow:num correct tokens: 0 INFO:tensorflow:total tokens: 170 INFO:tensorflow:Seconds elapsed in evaluation: 0.18, eval metric: 0.00% INFO:tensorflow:Processed 10 documents INFO:tensorflow:Total processed documents: 10 INFO:tensorflow:num correct tokens: 10 INFO:tensorflow:total tokens: 153 INFO:tensorflow:Seconds elapsed in evaluation: 0.86, eval metric: 6.54%
When they do not.
INFO:tensorflow:Total processed documents: 0 INFO:tensorflow:Total processed documents: 0
This is a question better suited for StackOverflow. Please ask it there and tag it with the tensorflow tag.