Neural Network Human Presence Detection

So I ran ls ./lib inside my neural_security_system directory and it returned libcpu_extension.so, and it also shows up when I run the sudo find / -name libcpu_extension.so command. Could it be looking at the wrong /lib directory? Meaning is it a linker issue?

Also, my inference_engine.hpp is located here /home/tc23/intel/openvino_2019.1.133/deployment_tools/inference_engine/include/inference_engine.hpp. Looking at the Makefile, it looks like it was looking at computer_vision_sdk and then further down on the path ubuntu_16.04, which neither directory seems to get created when installing openvino (at least anymore)

If you do cd ~/intel/computer_vision_sdk/deployment_tools/inference_engine/lib does it work? What are the contents of that folder if it does?

Also, where is the following located for you (which folders does it list):

sudo find / -name libinference_engine.so

It’s about time I start over from scratch with my own setup. I’ll be back with my updated steps and most likely a new branch of my repo soon.

Alright, I have confirmed the following works from a fresh installation of Ubuntu 16.04 with the latest version of OpenVINO 2019-R1:

sudo apt-get update
sudo apt-get install openssh-server

(reboot)

./install_GUI.sh  (not as root, install all packages)

(log in via ssh)

cd ~/intel/openvino/install_dependencies/
sudo -E ./install_openvino_dependencies.sh

sudo nano ~/.bashrc
(add in the "source ~/intel/openvino/bin/setupvars.sh" to the end of the file)

(exit ssh session, and log back in to ssh)
(This message should show up: "[setupvars.sh] OpenVINO environment initialized")

cd ~/intel/openvino/deployment_tools/model_optimizer/install_prerequisites
sudo ./install_prerequisites.sh

cd ~/intel/openvino/deployment_tools/demo
./demo_squeezenet_download_convert_run.sh

(back in the GUI version of Ubuntu)
cd ~/intel/openvino/deployment_tools/demo
./demo_security_barrier_camera.sh

(back in SSH)

cd ~/

sudo apt-get install git
sudo apt-get install libgflags-dev

git clone https://github.com/AndBobsYourUncle/neural_security_system.git
git checkout openvino-2019-R1
rm ./lib/libcpu_extension.so
cp ~/inference_engine_samples_build/intel64/Release/lib/libcpu_extension.so ./lib

cd ~/
git clone https://github.com/mystic123/tensorflow-yolo-v3.git
cd tensorflow-yolo-v3
wget https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names
wget https://pjreddie.com/media/files/yolov3.weights
wget https://pjreddie.com/media/files/yolov3-tiny.weights
cp ~/neural_security_system/yolo_v3_changed.json ./
cp ~/neural_security_system/yolo_v3_tiny_changed.json ./


python3 convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3-tiny.weights --output_graph frozen_tiny_yolov3_model.pb --tiny
python3 ~/intel/openvino/deployment_tools/model_optimizer/mo_tf.py --input_model frozen_tiny_yolov3_model.pb --tensorflow_use_custom_operations_config yolo_v3_tiny_changed.json --input_shape [1,416,416,3]
mv frozen_tiny_yolov3_model.xml ~/neural_security_system/models/tiny_yolov3/FP32/
mv frozen_tiny_yolov3_model.bin ~/neural_security_system/models/tiny_yolov3/FP32/
cp coco.names ~/neural_security_system/models/tiny_yolov3/FP32/frozen_tiny_yolov3_model.labels


cd ~/
git clone https://github.com/eclipse/paho.mqtt.c.git
cd paho.mqtt.c/
git checkout v1.2.1
cmake -Bbuild -H. -DPAHO_WITH_SSL=ON -DPAHO_BUILD_SHARED=ON
sudo cmake --build build/ --target install
sudo ldconfig

cd ~/
git clone https://github.com/eclipse/paho.mqtt.cpp
cd paho.mqtt.cpp/
cmake -Bbuild -H. -DPAHO_WITH_SSL=ON -DPAHO_BUILD_SHARED=ON
sudo cmake --build build/ --target install
sudo ldconfig

cd ~/neural_security_system/
rm neural_security_system
make -B
1 Like

If the above works for you, and you can successfully build and run, I will probably merge everything back into the master branch since everyone following this documentation is probably using the 2019 R1 build (that changes all the paths, breaking everything).

Thanks so much for taking the time to look at everything! I got as far as git checkout openvino-2019-R1, before I hit a snag.

tc23@NUC:~$ git checkout openvino-2019-R1
fatal: Not a git repository (or any of the parent directories): .git

That’s the message I received when I tried to run that command, everything else was successful until then

Edit: I’m stupid and just realized I didn’t cd into the new directory created by the prior step. I’ll continue the steps tonight when I back in front of my computer and report back. Thanks!

Alright, sorry about that, forgot to push the branch. It should be up now.

OK, working my way down the command list, but now I am getting the following when I try to run python3 convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3-tiny.weights --output_graph frozen_tiny_yolov3_model.pb --tiny

tc23@NUC:~/tensorflow-yolo-v3$ python3 convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3-tiny.weights --output_graph frozen_tiny_yolov3_model.pb --tiny
2019-05-14 21:04:08.111133: F tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use AVX instructions, but these aren’t available on your machine.
Aborted (core dumped)

I’m wondering if this is because I couldn’t downgrade tensorflow without using sudo?

Edit: I was able to successfully downgrade tensorflow by adding the --user option, so the command was pip3 install --user tensorflow==1.12.0 --upgrade but I am still getting the Abort (core dumped) message

This is likely because you are running a virtual machine with your CPU type set to something besides “host”.

Using your host CPU type for the VM should resolve this and you won’t need to downgrade tensorflow

Sorry, maybe that’s where are my problems are, I’m not on a VM, but rather a NUC with ubuntu as the OS :astonished: Also, I moved on and tried the make -B command again but was getting the same errors. I went into the Makefile and removed references to the ubuntu_16.04 directory and now I am down to only the libcpu_extension.so error. That said, I understand if I have taken up too much of your time already with so many questions!

If you followed the instructions here, then you shouldn’t have to modify the Makefile. I created that branch openvino-2018-R1 in my repository so that the Makefile was already good to go.

Once you checkout that branch, then the make -B command should work.

hmm i seem to be on the proper branch, and aside from the tensorflow AVX issue, I have gotten all the commands to work properly. Here is the response i get when I try checkout again.

tc23@NUC:~/neural_security_system$ git checkout openvino-2019-R1
M Makefile
M lib/libcpu_extension.so
D neural_security_system
Already on ‘openvino-2019-R1’
Your branch is up-to-date with ‘origin/openvino-2019-R1’.

But I’ll keep at it, its probably something stupid I’m doing on my end. Thank you for all your help, I’ll let you know if I’m successful:grin:

Run this and try make -B again:

git reset --hard

tc23@NUC:~/neural_security_system$ git reset --hard
HEAD is now at 54456cb Added initial clearing of MQTT topic

And getting the same error :cry:

/usr/bin/ld: cannot find -l:libcpu_extension.so
/usr/bin/ld: cannot find -linference_engine
collect2: error: ld returned 1 exit status
Makefile:22: recipe for target ‘neural_security_system’ failed
make: *** [neural_security_system] Error 1

Try running source ~/intel/openvino/bin/setupvars.sh

And then make -B again

Oooooh, now run git checkout openvino-2019-R1

After I checkout, should I go straight to make -B or are there other commands? Because straight to make -B didn’t work

What does git status say?

tc23@NUC:~/neural_security_system$ git status
On branch openvino-2019-R1
Your branch is up-to-date with ‘origin/openvino-2019-R1’.
Changes not staged for commit:
(use “git add/rm …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)

deleted: neural_security_system

no changes added to commit (use “git add” and/or “git commit -a”)