Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Cannot continue with MXNet Tutorial: Real-time Object Detection with MXNet On The Raspberry Pi #9094

Closed
roaur opened this issue Dec 15, 2017 · 9 comments

Comments

@roaur
Copy link

roaur commented Dec 15, 2017

Description

Cannot continue in MXNet Raspberry Pi tutorial (https://mxnet.incubator.apache.org/tutorials/embedded/wine_detector.html) after running import inception_predict in Python interpreter. Error describes the following: src/nnvm/legacy_json_util.cc:190: Loading symbol saved by previous version v0.8.0. Attempting to upgrade ... Segmentation fault

Environment info (Required)

----------Python Info----------
Version      : 3.5.3
Compiler     : GCC 6.3.0 20170124
Build        : ('default', 'Jan 19 2017 14:11:04')
Arch         : ('32bit', 'ELF')
------------Pip Info-----------
Version      : 9.0.1
Directory    : /usr/lib/python3/dist-packages/pip
----------MXNet Info-----------
Version      : 1.0.0
Directory    : /home/pi/git/mxnet/python/mxnet
Hashtag not found. Not installed from pre-built package.
----------System Info----------
Platform     : Linux-4.9.59-v7+-armv7l-with-debian-9.1
system       : Linux
node         : raspberrypi
release      : 4.9.59-v7+
version      : #1047 SMP Sun Oct 29 12:19:23 GMT 2017
----------Hardware Info----------
machine      : armv7l
processor    :
Architecture:          armv7l
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
Model:                 4
Model name:            ARMv7 Processor rev 4 (v7l)
CPU max MHz:           1200.0000
CPU min MHz:           600.0000
BogoMIPS:              76.80
Flags:                 half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
----------Network Test----------
Setting timeout: 10
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0308 sec, LOAD: 0.1390 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0385 sec, LOAD: 0.2170 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0056 sec, LOAD: 5.4054 sec.
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0143 sec, LOAD: 0.6619 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0537 sec, LOAD: 0.2372 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0785 sec, LOAD: 0.1326 sec.

Package used (Python/R/Scala/Julia):
Python 2.7

Build info (Required if built from source)

I used make? Instructions found at #7852

MXNet commit hash:
41394a4

Build config:

#-------------------------------------------------------------------------------
#  Template configuration for compiling mxnet
#
#  If you want to change the configuration, please use the following
#  steps. Assume you are on the root directory of mxnet. First copy the this
#  file so that any local changes will be ignored by git
#
#  $ cp make/config.mk .
#
#  Next modify the according entries, and then compile by
#
#  $ make
#
#  or build in parallel with 8 threads
#
#  $ make -j8
#-------------------------------------------------------------------------------

#---------------------
# choice of compiler
#--------------------

export CC = gcc
export CXX = g++
export NVCC = nvcc

# whether compile with options for MXNet developer
DEV = 0

# whether compile with debug
DEBUG = 0

# whether compile with profiler
USE_PROFILER =

# whether to turn on segfault signal handler to log the stack trace
USE_SIGNAL_HANDLER =

# the additional link flags you want to add
ADD_LDFLAGS =

# the additional compile flags you want to add
ADD_CFLAGS =

#---------------------------------------------
# matrix computation libraries for CPU/GPU
#---------------------------------------------

# whether use CUDA during compile
USE_CUDA = 0

# add the path to CUDA library to link and compile flag
# if you have already add them to environment variable, leave it as NONE
# USE_CUDA_PATH = /usr/local/cuda
USE_CUDA_PATH = NONE

# whether use CuDNN R3 library
USE_CUDNN = 0

#whether to use NCCL library
USE_NCCL = 0
#add the path to NCCL library
USE_NCCL_PATH = NONE

# whether use opencv during compilation
# you can disable it, however, you will not able to use
# imbin iterator
USE_OPENCV = 1

#whether use libjpeg-turbo for image decode without OpenCV wrapper
USE_LIBJPEG_TURBO = 0
#add the path to libjpeg-turbo library
USE_LIBJPEG_TURBO_PATH = NONE

# use openmp for parallelization
USE_OPENMP = 1

# MKL ML Library for Intel CPU/Xeon Phi
# Please refer to MKL_README.md for details

# MKL ML Library folder, need to be root for /usr/local
# Change to User Home directory for standard user
# For USE_BLAS!=mkl only
MKLML_ROOT=/usr/local

# whether use MKL2017 library
USE_MKL2017 = 0

# whether use MKL2017 experimental feature for high performance
# Prerequisite USE_MKL2017=1
USE_MKL2017_EXPERIMENTAL = 0

# whether use NNPACK library
USE_NNPACK = 0

# choose the version of blas you want to use
# can be: mkl, blas, atlas, openblas
# in default use atlas for linux while apple for osx
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Darwin)
USE_BLAS = apple
else
USE_BLAS = atlas
endif

# whether use lapack during compilation
# only effective when compiled with blas versions openblas/apple/atlas/mkl
USE_LAPACK = 1

# path to lapack library in case of a non-standard installation
USE_LAPACK_PATH =

# by default, disable lapack when using MKL
# switch on when there is a full installation of MKL available (not just MKL2017/MKL_ML)
ifeq ($(USE_BLAS), mkl)
USE_LAPACK = 0
endif

# add path to intel library, you may need it for MKL, if you did not add the path
# to environment variable
USE_INTEL_PATH = NONE

# If use MKL only for BLAS, choose static link automatically to allow python wrapper
ifeq ($(USE_MKL2017), 0)
ifeq ($(USE_BLAS), mkl)
USE_STATIC_MKL = 1
endif
else
USE_STATIC_MKL = NONE
endif

#----------------------------
# Settings for power and arm arch
#----------------------------
ARCH := $(shell uname -a)
ifneq (,$(filter $(ARCH), armv6l armv7l powerpc64le ppc64le aarch64))
	USE_SSE=0
else
	USE_SSE=1
endif

#----------------------------
# distributed computing
#----------------------------

# whether or not to enable multi-machine supporting
USE_DIST_KVSTORE = 0

# whether or not allow to read and write HDFS directly. If yes, then hadoop is
# required
USE_HDFS = 0

# path to libjvm.so. required if USE_HDFS=1
LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server

# whether or not allow to read and write AWS S3 directly. If yes, then
# libcurl4-openssl-dev is required, it can be installed on Ubuntu by
# sudo apt-get install -y libcurl4-openssl-dev
USE_S3 = 0

#----------------------------
# performance settings
#----------------------------
# Use operator tuning
USE_OPERATOR_TUNING = 1

# Use gperftools if found
USE_GPERFTOOLS = 1

# Use JEMalloc if found, and not using gperftools
USE_JEMALLOC = 1

#----------------------------
# additional operators
#----------------------------

# path to folders containing projects specific operators that you don't want to put in src/operators
EXTRA_OPERATORS =

#----------------------------
# other features
#----------------------------

# Create C++ interface package
USE_CPP_PACKAGE = 0

#----------------------------
# plugins
#----------------------------

# whether to use caffe integration. This requires installing caffe.
# You also need to add CAFFE_PATH/build/lib to your LD_LIBRARY_PATH
# CAFFE_PATH = $(HOME)/caffe
# MXNET_PLUGINS += plugin/caffe/caffe.mk

# whether to use torch integration. This requires installing torch.
# You also need to add TORCH_PATH/install/lib to your LD_LIBRARY_PATH
# TORCH_PATH = $(HOME)/torch
# MXNET_PLUGINS += plugin/torch/torch.mk

# WARPCTC_PATH = $(HOME)/warp-ctc
# MXNET_PLUGINS += plugin/warpctc/warpctc.mk

# whether to use sframe integration. This requires build sframe
# [email protected]:dato-code/SFrame.git
# SFRAME_PATH = $(HOME)/SFrame
# MXNET_PLUGINS += plugin/sframe/plugin.mk

Error Message:

>>> import inception_predict
[13:28:02] src/nnvm/legacy_json_util.cc:190: Loading symbol saved by previous version v0.8.0. Attempting to upgrade...
Segmentation fault

Minimum reproducible example

python
>>> import inception_predict

Steps to reproduce

  1. Follow instructions from Trouble installing MXNet on Raspberry Pi 3 #7852 by @FrancisTse8
  2. Run
python
>>> import inception_predict

What have you tried to solve it?

  1. Renamed Inception_BN-000.params to Inception-BN-0000.params
  2. download squeezenetv1.1-0000.params from http://data.mxnet.io/models/imagenet/squeezenet/

Should I try to build an older version of MXNet and try it again?

@andrubrown
Copy link

I'm experiencing the same problem with a similar config (the difference is I'm running MXNet in a virtual env).

I have tried:

  1. Downloading the alternate version of the model http://data.mxnet.io/models/imagenet/inception-bn_old.tar.gz
  2. Building an older version of MXNet (v0.11.0 seems like the oldest stable branch)

Neither fix the problem.

The log message suggests that an attempt is being made to upgrade the symbol from v0.8.0 but fails for some reason.

I'm new to MXNet and not sure what the differences might be in the symbol json file or API but I have also scoured the internet looking for way to manually edit the json file with no luck.

Any suggestions would be appreciated.

@wildhunter-66
Copy link

Hi,
To install mxnet use this address: https://www.pyimagesearch.com/2017/11/13/how-to-install-mxnet-for-deep-learning/
You have to change one line "git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet --branch 0.11.0" with "git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet --branch 1.0.0"
I have just installed it on virtual env. and I made a prediction with my own model.

@toponsky
Copy link

I have the same issue here. Using mxnet 1.0.1. Getting the actual error message. Do I have to reinstall mxnet using 0.8.0?

@wildhunter-66
Copy link

Hi yimingliu0216
Just install version 1.0.0 from https://github.com/apache/incubator-mxnet/releases/tag/1.0.0
It's working perfect.
On reading lines (170, 171, 172, 173) from file: https://github.com/apache/incubator-mxnet/blob/master/src/nnvm/legacy_json_util.cc you can see witch versions you can use:
170 {MXNET_MAKE_VERSION(100, 0, 0), UpgradeJSON_Parse},
171 {MXNET_MAKE_VERSION(0, 9, 0), UpgradeJSON_000800_000900},
172 {MXNET_MAKE_VERSION(0, 9, 4), UpgradeJSON_000903_000904},
173 {MXNET_MAKE_VERSION(0, 9, 5), UpgradeJSON_000904_000905},

@toponsky
Copy link

Thanks for the reply. I already downgrade to 1.0.0. It works fine now, but it wastes my date to reinstall the mxnet.

@reddyvsree
Copy link

reddyvsree commented Jan 19, 2018

Can you @wildhunter-66 tell me how to downgrade the mxnet version form 1.0.1 to v1.0.0 without having to reinstall from starting?

I'm getting same error on v1.0.1

@reddyvsree
Copy link

@yimingliu0216 Could you tell me how you downgraded version?

@larroy
Copy link
Contributor

larroy commented Jul 17, 2019

Is this fixed with the wine detection tutorial improvements?

@larroy
Copy link
Contributor

larroy commented Jul 17, 2019

If you have further issues, feel free to reopen or create a new one. I think we should close this for now.

@yuxihu yuxihu closed this as completed Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants