3

I'm attempting to setup AWS Greengrass with mxnet for Machine Learning on a Raspberry Pi.

When running ./mxnet_installer.sh from https://docs.aws.amazon.com/greengrass/latest/developerguide/ml-console.html#install-mxnet it takes ages and just disconnects my session with PuTTY.

It seems to be hanging on Running setup.py bdist_wheel for scipy - it sits there for about 2 hours before the PuTTY session is lost.

I'm executing the command on a clean PI, all all that has been done beforehand is modules 1 to 6 from https://docs.aws.amazon.com/greengrass/latest/developerguide/gg-gs.html

login as: pi
pi@192.168.0.49's password:
Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct  2 14:53:14 2018 from 192.168.0.13

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@raspberrypi:~ $ ls
aws-greengrass-samples         ggc-mxnet-v1.2.1-python-raspi.tar.gz
ggc-mxnet-v1.2.1-python-raspi
pi@raspberrypi:~ $ cd ggc-mxnet-v1.2.1-python-raspi/
pi@raspberrypi:~/ggc-mxnet-v1.2.1-python-raspi $ ls
greengrass-ml-squeezenet-object-classification-raspi-python.tar.gz
mxnet-1.2.1-py2.py3-none-any.whl
mxnet_examples.tar.gz
mxnet_installer.sh
mxnet-python-unit-test.tar.gz
pi@raspberrypi:~/ggc-mxnet-v1.2.1-python-raspi $ ./mxnet_installer.sh
Starting MXNET installation on the system...
Unittests:  N
Swapfile location:  /var/swap
Swapfile size:  1 GB
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  python-numpy-dbg python-numpy-doc
The following NEW packages will be installed:
  python-numpy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,694 kB of archives.
After this operation, 9,532 kB of additional disk space will be used.
Selecting previously unselected package python-numpy.
(Reading database ... 43734 files and directories currently installed.)
Preparing to unpack .../python-numpy_1%3a1.12.1-3_armhf.deb ...
Unpacking python-numpy (1:1.12.1-3) ...
Setting up python-numpy (1:1.12.1-3) ...
Processing triggers for man-db (2.7.6.1-2) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
liblapack3 is already the newest version (3.7.0-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libopenblas-dev is already the newest version (0.2.19-3+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
liblapack-dev is already the newest version (3.7.0-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version (2.7.13-2).
python-nose is already the newest version (1.3.7-2).
python-pip is already the newest version (9.0.1-2+rpt2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-opencv is already the newest version (2.4.9.1+dfsg1-2).
zip is already the newest version (3.0-11).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
dpkg: python-numpy: dependency problems, but removing anyway as you requested:
 python-opencv depends on python-numpy-abi9; however:
  Package python-numpy-abi9 is not installed.
  Package python-numpy which provides python-numpy-abi9 is to be removed.
 python-opencv depends on python-numpy (>= 1:1.6.1); however:
  Package python-numpy is to be removed.
 python-picamera depends on python-numpy.
 python-opencv depends on python-numpy-abi9; however:
  Package python-numpy-abi9 is not installed.
  Package python-numpy which provides python-numpy-abi9 is to be removed.
 python-opencv depends on python-numpy (>= 1:1.6.1); however:
  Package python-numpy is to be removed.

(Reading database ... 44120 files and directories currently installed.)
Removing python-numpy (1:1.12.1-3) ...
Processing triggers for man-db (2.7.6.1-2) ...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages (18.0)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: wheel in /usr/lib/python2.7/dist-packages (0.29.0)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: picamera in /usr/lib/python2.7/dist-packages (1.13)
Checking numpy...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: numpy in /usr/local/lib/python2.7/dist-packages (1.15.2)
'numpy' check complete!
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting scipy
  Using cached https://files.pythonhosted.org/packages/07/76/7e844757b9f3bf5ab9f951ccd3e4a8eed91ab8720b0aac8c2adcc2fdae9f/scipy-1.1.0.tar.gz
Building wheels for collected packages: scipy
  Running setup.py bdist_wheel for scipy ... |

Any suggestions?

L G
  • 497
  • 1
  • 7
  • 20
  • Can you run 'top' to see what processes are running and how much CPU they are taking (e.g. compilation)? There are posts re: scipy taking a long time and in one case it was due to excessive heat. Take a look at https://raspberrypi.stackexchange.com/questions/71759/problems-installing-scipy-stack-for-python3-6-on-pi-2 and this post about the installation seemingly hanging http://stackoverflow.com/questions/33848709/cant-install-scipy-freezes-on-running-setup-py-install-for-scipy One suggestion would be to run a 'screen' process on your raspberry pi so if Putty disconnects you can reconnect. – Vishaal Oct 09 '18 at 19:13
  • 1
    Append the first line of the script `mxnet_installer.sh` with `-xv` and place the output here so that we can help you. E.g., `/usr/bin/bash -xv` – yoonghm Oct 12 '18 at 17:54

1 Answers1

1
  1. Increase swap space.
  2. Install SciPy manually. Build from sources. See this answer
  3. Run mxnet_installer
TRiNE
  • 5,020
  • 1
  • 29
  • 42