Compile error Facenet under ncappzoo modules - python-3.x

I forgot to mention about my system sorry.
I am using Ubilinux 4 which is based on Debian Stretch. Its kernel is 4.9 LTS. Also my GCC is 7 and Movidius NCSDK is 2.04.00.06. Also I have installed Tensorflow 1.6.
I installed all necessary packages and libraries to compile FaceNet module, but it gives error at every tries.
I have ınstalled NCSDK 2.04.00.06 and tested it, and also compiled some apps/modules like AgeNet and TinyYolo. They are working without problems.
But when I give "make all" under "~/ncappzoo/tensorflow/facenet/", It gives this error:
making prereqs inception_resnet_v1.py exists, not regetting it.
making zipped model Zipped model already exists, skipping download
making model Zip file exists. Zip file unzipped. mv:
'model-20170512-110547.ckpt-250000.data-00000-of-00001' durumlanamadı:
Böyle bir dosya ya da dizin yok mv:
'model-20170512-110547.ckpt-250000.index' durumlanamadı: Böyle bir
dosya ya da dizin yok meta file exists Converted directory exists,
skipping conversion. #( Here says there is neither a file nor a directory named facenet_celeb_ncs.graph )
If you want to reconvert remove directory: facenet_celeb_ncs, and re-run
making compile Command line: mvNCCompile facenet_celeb_ncs.meta -w
facenet_celeb_ncs -s 12 -in input -on output -o
facenet_celeb_ncs.graph mvNCCompile v02.00, Copyright # Intel
Corporation 2017
Illegal instruction cp: 'facenet_celeb_ncs.graph' durumlanamadı: Böyle
bir dosya ya da dizin yok #( Here says there is neither a file nor a directory named facenet_celeb_ncs.graph )
I haven't tried to upgrade my movidius SDK because I may need update ncappzoo apps that I have modified.
I have problem with just FaceNet module and others works without an issue.
Also, I erased this "20170512-110547" directory and tried "make all" again and same issue still here.
making prereqs inception_resnet_v1.py exists, not regetting it.
making zipped model Zipped model already exists, skipping download
making model Zip file exists. Unzipping. Archive: 20170512-110547.zip
inflating: 20170512-110547/20170512-110547.pb inflating:
20170512-110547/model-20170512-110547.ckpt-250000.data-00000-of-00001
inflating: 20170512-110547/model-20170512-110547.ckpt-250000.index
inflating: 20170512-110547/model-20170512-110547.meta Converted
directory does not exist, doing conversion Illegal instruction
making compile /bin/sh: 7: cd: can't cd to
20170512-110547/facenet_celeb_ncs Command line: mvNCCompile
facenet_celeb_ncs.meta -w facenet_celeb_ncs -s 12 -in input -on output
-o facenet_celeb_ncs.graph mvNCCompile v02.00, Copyright # Intel Corporation 2017
Illegal instruction cp: 'facenet_celeb_ncs.graph' durumlanamadı: Böyle
bir dosya ya da dizin yok #( Here says there is neither a file nor a directory named facenet_celeb_ncs.graph )
How can i solve this problem. Thank you.

I found a solution for my issue. According here: https://github.com/tensorflow/tensorflow/issues/17411#issuecomment-370260582 I should downgrade my Tensorflow package. So after given this command:
python3 -m pip install tensorflow==1.5.0 --user
my issue solved. Thank you.

Related

Why are files missing after installation of my rpm?

I build my first rpm package. It is the prescriped way to deploy applications to our distributed SuSE Servers.
The application is build with NodeJs and Typescript.
We have a build step that transcribes the Typescript to Javascript into a dist folder. NPM provides the dependencies in a node_modules folder. Then there are some .env config files, a bash script to start the application called myApplication and a init.d script called myDaemon. These are all packed into a tar.gz file. The structure is the following:
myApplication.tar.gz
|
|--dist
| |
| |-index.js
| |-...
|
|--node_modules
| |
| |-dependency_a
| |-dependency_b
| |-...
|
|--.env
|--.env.production
|--.env.development
|--.env.sample
|--myApplication
|--myDaemon
The rpmbuild unpacks the tar.gz file, creates the needed folders in the build root and copies the files to the correct folders. dist and node_modules go the a folder in /opt. The configuration files to folder in /etc/, the daemon to /etc/init.d and the executable bash script to start the application to /usr/bin. The README is treated as documentation and the logfiles are marked as ghost.
This is the spec file:
%define debug_package %{nil}
# Use other payload algorithm to fix the following error on SuSE: Failed dependencies: rpmlib(FileDigests) <= 4.6.0-1 is needed
%define _binary_filedigest_algorithm 1
# automatically generate requires and provides from package.json
%{?nodejs_find_provides_and_requires}
# filter out any false provides created due to dependencies with native components
%{?nodejs_default_filter}
# name of zip file containing source without .zip extension
%define modname myApplication
Summary: The %{modname} is a nodeJs project
Name: %{modname}
Group: Applications/Server
Version: 0.1
Release: 1
License: None
URL: https://private.git/myApplication
Source0: myApplication.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: x86_64
ExclusiveArch: x86_64
BuildRequires: npm
Requires: nodejs10
AutoReq: no
AutoProv: no
%description
%{Summary}
#Unpack the tar.gz file
%prep
%setup -q -n myApplication
%build
#Code is already build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/myApplication
%{__cp} -r $RPM_BUILD_DIR/myApplication/.env* $RPM_BUILD_ROOT/etc/myApplication
mkdir -p $RPM_BUILD_ROOT/opt/myApplication/dist
%{__cp} -r $RPM_BUILD_DIR/myApplication/dist $RPM_BUILD_ROOT/opt/myApplication/
mkdir -p $RPM_BUILD_ROOT/opt/myApplication/node_modules
%{__cp} -r $RPM_BUILD_DIR/myApplication/node_modules $RPM_BUILD_ROOT/opt/myApplication/
mkdir -p $RPM_BUILD_ROOT/usr/bin
%{__cp} -r $RPM_BUILD_DIR/myApplication/myApplication $RPM_BUILD_ROOT/usr/bin/myApplication
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
%{__cp} -r $RPM_BUILD_DIR/myApplication/myDaemon $RPM_BUILD_ROOT/etc/init.d/myDaemon
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(0755, root, root)
%doc README.md
%dir /etc/myApplication
%config /etc/myApplication/.env
%config /etc/myApplication/.env.production
%config /etc/myApplication/.env.development
/etc/myApplication/.env.sample
/opt/myApplication
/usr/bin/myApplication
/etc/init.d/myDaemon
%ghost /var/log/myApplication.log
%ghost /var/log/myDaemon.log
%changelog
* Wed Sep 29 2021 seism0saurus
- Initial spec file for myApplication
The rpm build with -vv runs fine and lists all dependencies from node_modules. I can also open the rpm with a zip utility and can see all needed dependencies inside the /opt/myApplication/node_modules folder.
But only some of the dependencies in that node_modules folder are installed, when I run zypper install myApplication.rpm. For example dependency_b is missing but dependency_a was installed. I can check that with rpm -V -v --nodeps -p myApplication.rpm. The folders are marked as missing. Here is a part from the output:
.......T /opt/myApplication/node_modules/triple-beam/test.js
missing /opt/myApplication/node_modules/url-parse
missing /opt/myApplication/node_modules/url-parse/LICENSE
missing /opt/myApplication/node_modules/url-parse/README.md
missing /opt/myApplication/node_modules/url-parse/dist
missing /opt/myApplication/node_modules/url-parse/dist/url-parse.js
missing /opt/myApplication/node_modules/url-parse/dist/url-parse.min.js
missing /opt/myApplication/node_modules/url-parse/dist/url-parse.min.js.map
missing /opt/myApplication/node_modules/url-parse/index.js
missing /opt/myApplication/node_modules/url-parse/package.json
........ /opt/myApplication/node_modules/util-deprecate
I usually use Debian/GNU Linux and not SuSE, so I don't have any experience with rpm.
Can someone explain, why the folders and files are not installed, although rpm knows, that they should be installed and shows them as missing?
How can I fix that? Is something wrong with my spec or my approach to package a NodeJs application?
--- EDIT ---
The rpm package works fine inside my Leap 15 containers (rpm 4.14.3). The problems is only on a SLES 11 installation (rpm 4.4.2.3).
So the problems seems to be related with the old version of rpm.
--- EDIT 2 ---
I tweaked the spec by configuring the compression algorithm:
%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio
Now i can install the package correctly with rpm but zypper has still the same problem.
Any thoughts on that?
Kind regards,
seism0saurus
The final solution was to use a different compression algorithm in the spec file and to give the package a new version number, so that zypper doesn't use the old version from cache.
%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio

Compiling fluoride bluetooth stack for embedded linux

Has anyone been able to compile fluoride bluetooth stack separately for an embedded linux device?
There is a guide at https://android.googlesource.com/platform/system/bt/+/181144a50114c824cfe3cdfd695c11a074673a5e/README.md, but following these instructions gn gen fails without getting the common-mk folder and modding some build files so there are no missing variables, folders etc.
I have been able to generate Ninja files, but when building, there are missing gtest and modp_b64 headers. After getting them from Google's source search, Ninja seems to be able to run a bit without errors, but ultimately fails with:
In file included from ../../third_party/libchrome/base/message_loop/message_loop.h:18:
../../third_party/libchrome/base/message_loop/message_loop_current.h:209:3: error: static_assert failed due to requirement 'std::is_same<MessagePumpForUI, MessagePumpLibevent>::value' "MessageLoopCurrentForUI::WatchFileDescriptor is not supported when MessagePumpForUI is not a MessagePumpLibevent."
static_assert(std::is_same<MessagePumpForUI, MessagePumpLibevent>::value,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/libchrome/base/message_loop/message_loop_current.h:214:28: error: no type named 'Mode' in 'base::MessagePumpGlib'; did you mean 'MessagePumpLibevent::Mode'?
MessagePumpForUI::Mode mode,
^~~~~~~~~~~~~~~~~~~~~~
MessagePumpLibevent::Mode
../../third_party/libchrome/base/message_loop/watchable_io_message_pump_posix.h:55:8: note: 'MessagePumpLibevent::Mode' declared here
enum Mode {
^
In file included from ../../third_party/libchrome/base/run_loop.cc:10:
In file included from ../../third_party/libchrome/base/message_loop/message_loop.h:18:
../../third_party/libchrome/base/message_loop/message_loop_current.h:215:28: error: no type named 'FdWatchController' in 'base::MessagePumpGlib'; did you mean 'MessagePumpLibevent::FdWatchController'?
MessagePumpForUI::FdWatchController* controller,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MessagePumpLibevent::FdWatchController
../../third_party/libchrome/base/message_loop/message_pump_libevent.h:28:9: note: 'MessagePumpLibevent::FdWatchController' declared here
class FdWatchController : public FdWatchControllerInterface {
^
In file included from ../../third_party/libchrome/base/run_loop.cc:10:
In file included from ../../third_party/libchrome/base/message_loop/message_loop.h:18:
../../third_party/libchrome/base/message_loop/message_loop_current.h:216:28: error: no type named 'FdWatcher' in 'base::MessagePumpGlib'; did you mean 'MessagePumpLibevent::FdWatcher'?
MessagePumpForUI::FdWatcher* delegate);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
MessagePumpLibevent::FdWatcher
../../third_party/libchrome/base/message_loop/watchable_io_message_pump_posix.h:17:9: note: 'MessagePumpLibevent::FdWatcher' declared here
class FdWatcher {
^
4 errors generated.
All the errors and missing files are coming from third_party/libchrome
Any help would be much appreciated.
I followed instructions at https://cs.android.com/android/platform/superproject/+/master:system/bt/README.md
In addition to instructions there, I had to resolve issues in the build script manually. I was able to compile the bluetooth stack successfully in Ubuntu 21.04
Replace //bt with /home/udara/fluoride/bt in build files.
Used sed command. Change to your fluoride directory as appropriate.
for file in $(grep -r -l "//bt"); do sed -i 's/\/\/bt/\/home\/udara\/fluoride\/bt/g' $file; done
Copied common-mk symlink generated by bootstrap.py to the fluoride directory.
And replaced //common-mk with /home/udara/fluoride/common-mk.
for file in $(grep -r -l "//common-mk"); do sed -i 's/\/\/common-mk/\/home\/udara\/fluoride\/common-mk/g' $file; done
Installed few missing dependencies
sudo apt install llvm
sudo apt install libc++abi-dev
Copied /home/udara/fluoride/bt/output/out/Default/gen/ABS_PATH/home/udara/fluoride/bt/gd/dumpsys/bundler/bundler_generated.h to /home/udara/fluoride/bt/gd/dumpsys/
cp /home/udara/fluoride/bt/output/out/Default/gen/ABS_PATH/home/udara/fluoride/bt/gd/dumpsys/bundler/bundler_generated.h /home/udara/fluoride/bt/gd/dumpsys/
Created directory named output in the bt directory.
Set environment variables
# this is set by bootstrap.py
export STAGING_DIR=/home/udara/fluoride/staging
# you have to manually set this
export OUTPUT_DIR=/home/udara/fluoride/bt/output
Then compile the bluetooth stack with
./build.py --output ${OUTPUT_DIR} --platform-dir ${STAGING_DIR} --clang
Add the following lines to /etc/dbus-1/system.d/bluetooth.conf
<policy>
...
<allow own="org.chromium.bluetooth"/>
<allow own="org.chromium.bluetooth.Manager"/>
</policy>
Finally run fluoride with
cd /home/udara/fluoride/bt/output/debug
sudo ./btadapterd --hci=0 INIT_gd_hci=true
The reason the common-mk issues are coming up because between the instructions being written, and now, libchrome has added a BUILD.gn file - so it is being used, instead of the substitute one in build/secondary/third-party/libchrome as intended. To fix this part of the build, just delete third-party/libchrome/BUILD.gn - should prevent the need for a lot of build fiddling.
The second part is because of the configuration of libchrome. Once you remove the file mentioned, then you need to modify build/secondary/third-party/libchrome/BUILD.gn to add the following not just to the source_set (as is done in upstream) but also to libchrome_config for downstream users:
defines = [
"__ANDROID_HOST__=1",
]
This will affect the build config so it doesn't try to use glib.
My best work on getting this to build is here, though I haven't gotten it to work entirely. https://github.com/rpavlik/fluoride I did this mostly as an experiment, feel free to continue where I left off.

binutils not able to find isl

yes this question has been asked before. no the other answers doesn't solve my problem.
I have just built isl from source both 0.15 and 0.22.
I have isl and I know where it is and I am amazed that even though I have pointed to where the program is in configure binutils can't find it.
It did work a few months ago to do it this way.
../gitrepos/binutils/configure --prefix=/tools --with-sysroot=x86_64-w64-cygwin --with-lib-path=/tools/lib --disable-nls --disable-werror lt_cv_objdir=.libs --target=x86_64-w64-cygwin --with-isl=/home/brazg/usr/isl/0.22
I am getting the following error: required isl version is 0.15 or
later configure: error: Unable to find a usable isl. See config.log
for details.
/tmp/cc3B0zAy.s: Assembler messages:
/tmp/cc3B0zAy.s:14: Error: unknown .loc sub-directive `view'
/tmp/cc3B0zAy.s:14: Error: junk at end of line, first unrecognized character is `-'
/tmp/cc3B0zAy.s:20: Error: unknown .loc sub-directive `view'
/tmp/cc3B0zAy.s:20: Error: unknown pseudo-op: `.lvu1'
/tmp/cc3B0zAy.s:23: Error: unknown .loc sub-directive `view'
/tmp/cc3B0zAy.s:23: Error: unknown pseudo-op: `.lvu2'
configure:5079: $? = 1
configure: failed program was:
Yes I am aware that there are a whole lot of assembler errors because of the version of GCC in Cygwin. I am trying to replace it by building a more current version of gcc.
This is a common problem I have been running into. when building some source code in Cygwin. It seems one of the programs that runs into this is binutils...
I'm not sure what to do.
and yes, I could try cross compiling in Linux, no I don't want to and I'm hoping I don't have to. I'd like to do this naively to Windows if I can.
It seems to me that you are complicating yourself the life (x86_64-pc-cygwin is platform specific, not your choice) and you should start using the standard cygport tool, the same configuration already used for the binutils cygwin package and the isl 0.16.1 available. When you have problem with configure the proper config.log will provide the hint on what is going wrong.
Herebelow the a recipe to build the last released binutils 2.33.1 and create a cygwin package. For my test I am using the stable packages:
$ cygcheck -cd binutils gcc-core libisl-devel
Cygwin Package Information
Package Version
binutils 2.31.1-1
gcc-core 7.4.0-1
libisl-devel 0.16.1-1
but you can also try with the test 8.3.0-1 gcc compiler.
Download the source package and extract the binutils.cygport
$ wget http://mirrors.kernel.org/sourceware/cygwin/x86/release/binutils/binutils-2.31.1-1-src.tar.xz
$ tar -xf binutils-2.31.1-1-src.tar.xz
$ cp binutils-2.31.1-1.src/binutils.cygport .
Adjusting the cygport file to build from release 2.33.1 and not from git
$ cat binutils.cygport
TOOLCHAIN_TARGET="native"
# GIT_URI="git://sourceware.org/git/binutils-gdb.git"
# inherit toolchain git
# GIT_REV=be46fa23042ec88a7a42030476a301bf72a80e7e
# SRC_DIR=binutils-gdb
NAME="binutils"
VERSION=2.33.1
RELEASE=1
CATEGORY="Devel"
SUMMARY="GNU assembler, linker, and similar utilities"
DESCRIPTION="This directory contains various GNU compilers, assemblers, linkers,
debuggers, etc., plus their support routines, definitions, and documentation."
HOMEPAGE="http://www.gnu.org/software/binutils/"
case ${VERSION} in
*.*.[5-9][0-9])
SRC_URI="ftp://sourceware.org/pub/binutils/snapshots/binutils-${VERSION}.tar.bz2" ;;
*) SRC_URI="mirror://gnu/binutils/binutils-${VERSION}.tar.xz"
SRC_DIR=${PN}-${PV}
;;
esac
#PATCH_URI+=" 2.24.51-shared-libs.patch"
#2.24.51-ld-__dso_handle.patch
#PATCH_URI+="
#2.24.51-ld-__dso_handle.patch
#detect-rebasing-and-compute-an-address-bias.patch
#"
#PATCH_URI="e643cb45bf85fa5c8c49a89ff177de246af4212e.patch"
# gdb,etc.: https://sourceware.org/ml/binutils/2014-01/msg00341.html
# for shared libbfd/libopcodes, add:
# --enable-shared
CYGCONF_ARGS="
--enable-install-libiberty
--disable-gdb
--disable-libdecnumber
--disable-readline
--disable-sim
--enable-64-bit-bfd
"
# --enable-targets=i686-efi-pe,x86_64-efi-pe,ia64-efi-elf,x86_64-pc-cygwin,i686-pc-cygwin
src_install() {
cd ${B}
cyginstall
# for shared libbfd/libopcodes, add:
# APIs are unstable, do not allow linking against DLLs
# rm -f ${D}/usr/lib/*.dll.a
# sed -i -e '/^library_names=/d' ${D}/usr/lib/lib*.la
}
As you can note that I have NOT changed the arguments of binutils configuration. So now I can build the 2.33.1 package:
$ cygport binutils.cygport download
...
binutils-2.33.1.tar 100%[===================>] 20.50M 1.50MB/s in 15s
2020-01-04 17:07:52 (1.38 MB/s) - ‘binutils-2.33.1.tar.xz.tmp’ saved [21490848/21490848]
$ cygport binutils.cygport almostall
>>> Preparing binutils-2.33.1-1.x86_64
>>> Unpacking source binutils-2.33.1.tar.xz
>>> Preparing working source directory
...
>>> Creating source patches
0 files changed
>>> Creating source package
binutils-2.33.1-1.src/
binutils-2.33.1-1.src/binutils-2.33.1.tar.xz
binutils-2.33.1-1.src/binutils.cygport
>>> binutils requires: cygwin libgcc1
and you can also test the build:
$ cygport binutils.cygport check
=== binutils Summary ===
# of expected passes 136
# of unexpected failures 1
# of expected failures 1
# of unsupported tests 5
I notice an hang at the end of the test, but the check seems completed, co it could be to other factors that I will not investigate.

Compiling python pyo files

I have an old c++/python project that includes a python zip file "python27.zip". This zip file contains pyo optimized files.
I am trying to update python from 2.7 to the latest 3.7.1 (also updated the *.so lib file)
I did the next steps:
./configure --enable-shared --prefix=~/python-3.7.1/dist
make
sudo make install
I see that I have ~/python-3.7.1/dist/lib/python3.7 and it's structure is close to that I have in my old 2.7 zip.
Next I try to compile all the folder into pyo like:
python3.7 -O -m compileall .
It tells me that it requires Lib and Include (the headers) so I copied those 2 folders in that location too.
Doing python3.7 -O -m compileall . again inside dist/lib/python3.7 shows me
Listing './Lib/site-packages'...
Listing './Lib/sqlite3'...
....
and some errors like:
Compiling './Lib/test/badsyntax_future10.py'...
*** File "./Lib/test/badsyntax_future10.py", line 3
from __future__ import print_function
^
SyntaxError: from __future__ imports must occur at the beginning of the file
I don't see any pyo's inside. Also if I try to do the same against 1 file, like python3.7 -O token.py (no errors) and also no pyo inside.
Don't judge me strict, I agree that I can be wrong in understanding this compilation process.
I had to create my own tool since I had not found anything suitable for the compilation of all python modules into one location/archive.
This PY_COMPILE_HELPER is available on the github. It was tested only from ubuntu.
With this module you can:
Set input and output folder for the compilation
Output source will have the same structure as the input source
Set optimization level for binary files
Skip or include test modules
Compress compiled files into one archive
Clean previously compiled files from the cache
Usage example:
$ ./py_compile_helper.py ./Python-3.7.1/Lib ./out -z -c -o2

RPM + error during build RPM

please advice why I get the error "Bad file: /root/rpmbuild/SOURCES/test.sh"
I need to create rpm file ,
I only have the spec file under SPECS
and the test.sh script under SOURCES
what’s wrong here?
[root#linux /usr/src/redhat]# ls
BUILD RPMS SOURCES SPECS SRPMS
the spec file:
Summary: An example tool. To show a simple rpm build of the tool.
Name: test.sh
Version: 6.2
Release: 2
Source:/root/test.sh
Group: Development/Debuggers
BuildRoot:/var/tmp/test.sh
%description
Bad file: /root/rpmbuild/SOURCES/test.sh: No such file or directory RPM build errors: Bad file: /root/rpmbuild/SOURCES/test.sh: No such file or directory
The path to sources is never used; all source files must be in %{_sourcedir}, with the same name as the last component of the path.

Resources