Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

RuntimeError: Bad magic number when installing NC API

idata
Employee
1,883 Views

The ./convert_models.sh step spits only that error. Python version is 3.5.3.

 

Thanks,

 

Tom

0 Kudos
12 Replies
idata
Employee
1,486 Views

Intel Graphics Driver causes my Windows 10 screen to frequently go black.

0 Kudos
idata
Employee
1,486 Views

Hi @fortiss,

 

I tried reproducing your issue on a couple existing systems (on which NCS worked well), and also made a fresh install on a clean Ubuntu 16.04 machine; all of these systems have python 3.5.2. The toolkit/setup.sh script installs python3, but it doesn't really specify a sub-version, I see that the package version for Ubuntu 16.04 is 3.5.1-3 (which is actually 3.5.2). Perhaps you manually installed python 3.5.3 on your machine? If so, can you please uninstall/purge it, run sudo apt-get install python3 python3-pip, and then run ncapi/setup.sh? (you probably don't have to rerun toolkit/setup.sh)

 

Excerpt from toolkit/setup.sh:

 

$SUDO_PREFIX apt-get $APT_QUIET install -y unzip coreutils curl git python3 python3-pip

 

PS: Let me know if above suggestion works, I am curious to know if the problem is due to the difference in subversion.

0 Kudos
idata
Employee
1,486 Views

It looks like python made a breaking change in 3.5.3 and updated the magic number. http://bugs.python.org/issue27286

0 Kudos
idata
Employee
1,486 Views

Hi @"Ashwin Vijayakumar",

 

I trying to install sdk on Ubuntu 17.04 and have a similar problem because it uses python 3.5.3. It seems it will be easy to fix api build if I can rebuild mvNCCompile.pyc from source.

0 Kudos
idata
Employee
1,486 Views

@albor thanks for trying out the SDK on 17.04, I was building a fresh machine with 17.04 so I could test. The API and toolkit currently aren't OpenSouce, so can you please move to a 16.04 machine with 3.5.2?

0 Kudos
idata
Employee
1,486 Views

@AshwinVijayakumar,

 

I downgraded to 16.04 and was able to run samples :). Unfortunately on 17.04 as far as I understand graphviz python wrapper is not "binding" with graphviz properly out of the box. That prevents movidius sdk setup even if magic number problem resolved.

0 Kudos
idata
Employee
1,486 Views
python3 ./mvNCCompile.pyc data/lenet8.prototxt -s 12 RuntimeError: Bad magic number in .pyc file Makefile:21: recipe for target 'example00' failed make: *** [example00] Error 1

 

With Python 3.4.2 on BunsenLabs (Debian Jessie)

0 Kudos
idata
Employee
1,486 Views

@BQBQ Probably the difference between BunsenLabs and Ubuntu is causing this. Please try to use Ubuntu 16.04 (and Python 3.5.2 by default on it) as recommended in "Getting Started Guide" which is proven to run examples correctly.

0 Kudos
idata
Employee
1,486 Views

Would it be possible to get the non-cythoned version of the mvNCCompile script? It's possible to navigate around most other problems on non-Ubuntu systems (such as Debian / raspbian / ubilinux, etc), but this Python sub-version dependency essentially requires one to install Ubuntu in a chroot, which complicates deployment work quite a bit.

0 Kudos
idata
Employee
1,486 Views

@gekko Your concern is a valid and the SDK's dependency on Python 3.5.2 is an issue that we know about and one that we are looking into.

0 Kudos
idata
Employee
1,486 Views

So I would comment here:

 

https://ncsforum.movidius.com/discussion/242/bad-magic-number-in-pyc-file

 

, but also getting the error while building the NCAPI via shell script.

 

Saving to: ‘../images/cat.jpg’ cat.jpg 100%[===================>] 137.10K --.-KB/s in 0.03s Last-modified header missing -- time-stamps turned off. 2017-10-10 13:14:00 (4.90 MB/s) - ‘../images/cat.jpg’ saved [140391/140391] ../../bin RuntimeError: Bad magic number in .pyc file RuntimeError: Bad magic number in .pyc file RuntimeError: Bad magic number in .pyc file RuntimeError: Bad magic number in .pyc file RuntimeError: Bad magic number in .pyc file

 

Thoughts?

0 Kudos
idata
Employee
1,486 Views

@karl What python version are you using? Assuming this is with the 1.07.10 release, you can also give the newest release a try: https://github.com/movidius/ncsdk/releases/tag/v1.09.00.06 and for more information: https://ncsforum.movidius.com/discussion/98/latest-version-movidius-neural-compute-sdk#latest

0 Kudos
Reply