1

My plan is it to identify pictures of music instruments to say what kind of instrument it is. I do it with tensorflow based program "luminoth". It works! But now i try to execute the prediction via app. I wrote a script to upload a picture to a server with php file. Now i have a problem:

The script.sh is:

#!/bin/bash -l
lumi predict image1.jpg –checkpoint instruments -f /var/www/html/pictures/predictions/objects.json -d /var/www/html/pictures/predictions/

and when i make it executable (sudo chmod 777 script.sh) i can execute it via ./script.sh. Everything works and i get the predicted image.

But when try to execute it with this php file:

<?php
exec("./script.sh");
?>

Nothing happens.

But when i change the script.sh file to:

#!/bin/bash -l
mkdir hello

"hello" is created.

So to execute the second script.sh via php works! To execute the first one in shell works too! But to execute the first script.sh via php does not.

Do you have any ideas? Thanks a lot and have a good day!

5
  • 1
    Check this out stackoverflow.com/questions/5882650/… Commented Mar 9, 2020 at 10:28
  • @MartinHetzenegger : Did you try to trace your script with set -x? Commented Mar 9, 2020 at 10:33
  • sudo chmod 777 script.sh do way more than just making it executable. Commented Mar 9, 2020 at 11:48
  • I tried everything, but it does not work :-/ When I put mkdir commands before and after the "lumi predict" command, boths mkdir commands works, so the php script works and does not stop.. the problem must be lumi.. Commented Mar 21, 2020 at 9:37
  • Hey guys! I tried some new things. now i got the php output: "Luminoth requires a TensorFlow >= 1.5 installation. Depending on your use case, you should install either tensorflow or tensorflow-gpu packages manually or via PyPI. " so I think the problem is, that, when execute in browse via php, luminoth is not able to find tensorflow. Du you have any ideas how to solve this problem? :-) Commented Mar 28, 2020 at 17:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.