无法在 Jetson Nano 上安装 scikit_learn
Cannot install scikit_learn on Jetson Nano
我关注了这些主题:
- https://devtalk.nvidia.com/default/topic/1044958/jetson-agx-xavier/scikit-learn-for-python-3-on-jetson-xavier/
- https://devtalk.nvidia.com/default/topic/1049684/jetson-nano/errors-during-install-sklearn-/
- https://github.com/scikit-learn/scikit-learn/issues/12707
python版本:3.6.9
这是我的所有命令 运行:
sudo apt-get update
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools
sudo pip3 install -U numpy==1.16.1 future==0.17.1 mock==3.0.5 h5py==2.9.0 keras_preprocessing==1.0.5 keras_applications==1.0.8 gast==0.2.2 enum34 futures protobuf
sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v43 tensorflow-gpu==1.15.0+nv19.12
sudo apt-get install python3-opencv
sudo apt-get install python3-pandas
sudo apt-get install python3-keras
sudo apt-get install gfortran
sudo apt-get install python3-scipy
sudo apt-get install python3-matplotlib
sudo apt-get install python3-imageio
pip3 install dlib
sudo apt-get install -y build-essential libatlas-base-dev
pip3 install --upgrade setuptools
sudo pip3 install -U setuptools
sudo apt-get install libpcap-dev libpq-dev
sudo pip3 install cython
sudo pip3 install git+https://github.com/scikit-learn/scikit-learn.git
我得到下面的长错误
compile options: '-I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: scipy/cluster/_hierarchy.c
In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from scipy/cluster/_hierarchy.c:598:
/usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^~~~~~~
scipy/cluster/_hierarchy.c:19289:18: warning: ‘__Pyx_CFunc_double____double____double____double____int____int____int___to_py’ defined but not used [-Wunused-function]
static PyObject *__Pyx_CFunc_double____double____double____double____int____int____int___to_py(double (*__pyx_v_f)(double, double, double, int, int, int)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_27nn_chain’:
scipy/cluster/_hierarchy.c:13560:10: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (__pyx_t_12) {
^
scipy/cluster/_hierarchy.c:13074:7: note: ‘__pyx_v_y’ was declared here
int __pyx_v_y;
^~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_23linkage’:
scipy/cluster/_hierarchy.c:11431:16: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_23 = __pyx_v_y;
~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:11060:7: note: ‘__pyx_v_y’ was declared here
int __pyx_v_y;
^~~~~~~~~
scipy/cluster/_hierarchy.c:11421:16: warning: ‘__pyx_v_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_22 = __pyx_v_x;
~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:11059:7: note: ‘__pyx_v_x’ was declared here
int __pyx_v_x;
^~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_25fast_linkage’:
scipy/cluster/_hierarchy.c:12682:92: warning: ‘__pyx_v_dist’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_44 * __pyx_v_D.strides[0]) )) = __pyx_v_new_dist((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_42 * __pyx_v_D.strides[0]) ))), (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_43 * __pyx_v_D.strides[0]) ))), __pyx_v_dist, __pyx_v_nx, __pyx_v_ny, __pyx_v_nz);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/cluster/_hierarchy.c:11978:10: note: ‘__pyx_v_dist’ was declared here
double __pyx_v_dist;
^~~~~~~~~~~~
scipy/cluster/_hierarchy.c:11971:7: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int __pyx_v_y;
^~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_29mst_single_linkage’:
scipy/cluster/_hierarchy.c:14363:142: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_Z.data + __pyx_t_25 * __pyx_v_Z.strides[0]) ) + __pyx_t_26 * __pyx_v_Z.strides[1]) )) = __pyx_v_y;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:13995:7: note: ‘__pyx_v_y’ was declared here
int __pyx_v_y;
^~~~~~~~~
aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.6/scipy/cluster/_hierarchy.o -Lbuild/temp.linux-aarch64-3.6 -o build/lib.linux-aarch64-3.6/scipy/cluster/_hierarchy.cpython-36m-aarch64-linux-gnu.so -Wl,--version-script=build/temp.linux-aarch64-3.6/link-version-scipy.cluster._hierarchy.map
building 'scipy.cluster._optimal_leaf_ordering' extension
compiling C sources
C compiler: aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
compile options: '-I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: scipy/cluster/_optimal_leaf_ordering.c
In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from scipy/cluster/_optimal_leaf_ordering.c:598:
/usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^~~~~~~
scipy/cluster/_optimal_leaf_ordering.c: In function ‘__pyx_pf_5scipy_7cluster_22_optimal_leaf_ordering_optimal_leaf_ordering.isra.58’:
scipy/cluster/_optimal_leaf_ordering.c:4747:19: warning: ‘__pyx_v_best_w’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_117 = __pyx_v_best_w;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:3414:7: note: ‘__pyx_v_best_w’ was declared here
int __pyx_v_best_w;
^~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:4746:19: warning: ‘__pyx_v_best_u’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_116 = __pyx_v_best_u;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:3413:7: note: ‘__pyx_v_best_u’ was declared here
int __pyx_v_best_u;
^~~~~~~~~~~~~~
aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.6/scipy/cluster/_optimal_leaf_ordering.o -Lbuild/temp.linux-aarch64-3.6 -o build/lib.linux-aarch64-3.6/scipy/cluster/_optimal_leaf_ordering.cpython-36m-aarch64-linux-gnu.so -Wl,--version-script=build/temp.linux-aarch64-3.6/link-version-scipy.cluster._optimal_leaf_ordering.map
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating /tmp/tmpvz7d4hd0/tmp
creating /tmp/tmpvz7d4hd0/tmp/tmpvz7d4hd0
compile options: '-I/usr/include/python3.6m -c'
extra options: '-std=c++14'
aarch64-linux-gnu-g++: /tmp/tmpvz7d4hd0/main.c
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating /tmp/tmp3j3pimiu/tmp
creating /tmp/tmp3j3pimiu/tmp/tmp3j3pimiu
compile options: '-I/usr/include/python3.6m -c'
extra options: '-std=c++14 -fvisibility=hidden'
aarch64-linux-gnu-g++: /tmp/tmp3j3pimiu/main.c
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating /tmp/tmpmxeh9kyu/tmp
creating /tmp/tmpmxeh9kyu/tmp/tmpmxeh9kyu
compile options: '-I/usr/include/python3.6m -c'
aarch64-linux-gnu-g++: /tmp/tmpmxeh9kyu/main.c
building 'scipy.fft._pocketfft.pypocketfft' extension
compiling C++ sources
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating build/temp.linux-aarch64-3.6/scipy/fft
creating build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft
compile options: '-DPOCKETFFT_PTHREADS -I/home/dlinano/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
extra options: '-std=c++14 -fvisibility=hidden'
aarch64-linux-gnu-g++: scipy/fft/_pocketfft/pypocketfft.cxx
scipy/fft/_pocketfft/pypocketfft.cxx:15:10: fatal error: pybind11/pybind11.h: No such file or directory
#include <pybind11/pybind11.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Running from scipy source directory.
/usr/local/lib/python3.6/dist-packages/numpy/distutils/system_info.py:728: UserWarning: Specified path /usr/local/include/python3.6m is invalid.
return self.get_paths(self.section, key)
error: Command "aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPOCKETFFT_PTHREADS -I/home/dlinano/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c scipy/fft/_pocketfft/pypocketfft.cxx -o build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o -MMD -MF build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-dfzx1730/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy>=1.13.3' 'scipy>=0.19.1' Check the logs for full command output.
请查看完整日志:
https://drive.google.com/file/d/1gLcSq86Aic5uFoPr8k6Cp366eRB2tlfw/view?usp=sharing
这对我有用。
sudo -H pip3 install scikit-learn
这是我的完整安装脚本,用于安装依赖项的顺序。
#tensorflow - zoo
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
sudo apt-get install python3-pip
sudo -H pip3 install -U pip
sudo -H pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor==0.8.0 termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta
sudo -H pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.14.0
#Cython
sudo -H pip3 install cython
#keras-zoo
sudo apt-get install -y build-essential libatlas-base-dev gfortran
sudo -H pip3 install keras
#Pandas
sudo -H pip3 install pandas
#Scipy
sudo -H python3 -m pip install scipy==1.1.0
#Sklearn
sudo -H pip3 install scikit-learn
我在使用 Jupyter (Jetson TX2) 时遇到了问题
我检查了Jupyter使用的是哪个numpy版本。
import numpy as np
np.version.version
在我的例子中它是 1.13,尽管
$ pip3 list
向我展示了 numpy 的 1.16 版
我在这里 https://fooobar.com/questions/15251639/jupyter-notebook-picks-older-version-of-numpy
找到了解决方案
查看numpy路径
print (np.__path__)
在我的例子中是 /usr/lib/python3/dist-packages
进入目录并删除旧版本 numpy
$ cd /usr/lib/python3/dist-packages
$ sudo rm -r numpy
安装了相关的numpy版本
$ sudo pip install numpy==1.16.1
就这些了。
我关注了这些主题:
- https://devtalk.nvidia.com/default/topic/1044958/jetson-agx-xavier/scikit-learn-for-python-3-on-jetson-xavier/
- https://devtalk.nvidia.com/default/topic/1049684/jetson-nano/errors-during-install-sklearn-/
- https://github.com/scikit-learn/scikit-learn/issues/12707
python版本:3.6.9
这是我的所有命令 运行:
sudo apt-get update
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools
sudo pip3 install -U numpy==1.16.1 future==0.17.1 mock==3.0.5 h5py==2.9.0 keras_preprocessing==1.0.5 keras_applications==1.0.8 gast==0.2.2 enum34 futures protobuf
sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v43 tensorflow-gpu==1.15.0+nv19.12
sudo apt-get install python3-opencv
sudo apt-get install python3-pandas
sudo apt-get install python3-keras
sudo apt-get install gfortran
sudo apt-get install python3-scipy
sudo apt-get install python3-matplotlib
sudo apt-get install python3-imageio
pip3 install dlib
sudo apt-get install -y build-essential libatlas-base-dev
pip3 install --upgrade setuptools
sudo pip3 install -U setuptools
sudo apt-get install libpcap-dev libpq-dev
sudo pip3 install cython
sudo pip3 install git+https://github.com/scikit-learn/scikit-learn.git
我得到下面的长错误
compile options: '-I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: scipy/cluster/_hierarchy.c
In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from scipy/cluster/_hierarchy.c:598:
/usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^~~~~~~
scipy/cluster/_hierarchy.c:19289:18: warning: ‘__Pyx_CFunc_double____double____double____double____int____int____int___to_py’ defined but not used [-Wunused-function]
static PyObject *__Pyx_CFunc_double____double____double____double____int____int____int___to_py(double (*__pyx_v_f)(double, double, double, int, int, int)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_27nn_chain’:
scipy/cluster/_hierarchy.c:13560:10: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (__pyx_t_12) {
^
scipy/cluster/_hierarchy.c:13074:7: note: ‘__pyx_v_y’ was declared here
int __pyx_v_y;
^~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_23linkage’:
scipy/cluster/_hierarchy.c:11431:16: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_23 = __pyx_v_y;
~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:11060:7: note: ‘__pyx_v_y’ was declared here
int __pyx_v_y;
^~~~~~~~~
scipy/cluster/_hierarchy.c:11421:16: warning: ‘__pyx_v_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_22 = __pyx_v_x;
~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:11059:7: note: ‘__pyx_v_x’ was declared here
int __pyx_v_x;
^~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_25fast_linkage’:
scipy/cluster/_hierarchy.c:12682:92: warning: ‘__pyx_v_dist’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_44 * __pyx_v_D.strides[0]) )) = __pyx_v_new_dist((*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_42 * __pyx_v_D.strides[0]) ))), (*((double *) ( /* dim=0 */ (__pyx_v_D.data + __pyx_t_43 * __pyx_v_D.strides[0]) ))), __pyx_v_dist, __pyx_v_nx, __pyx_v_ny, __pyx_v_nz);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/cluster/_hierarchy.c:11978:10: note: ‘__pyx_v_dist’ was declared here
double __pyx_v_dist;
^~~~~~~~~~~~
scipy/cluster/_hierarchy.c:11971:7: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int __pyx_v_y;
^~~~~~~~~
scipy/cluster/_hierarchy.c: In function ‘__pyx_pw_5scipy_7cluster_10_hierarchy_29mst_single_linkage’:
scipy/cluster/_hierarchy.c:14363:142: warning: ‘__pyx_v_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_Z.data + __pyx_t_25 * __pyx_v_Z.strides[0]) ) + __pyx_t_26 * __pyx_v_Z.strides[1]) )) = __pyx_v_y;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:13995:7: note: ‘__pyx_v_y’ was declared here
int __pyx_v_y;
^~~~~~~~~
aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.6/scipy/cluster/_hierarchy.o -Lbuild/temp.linux-aarch64-3.6 -o build/lib.linux-aarch64-3.6/scipy/cluster/_hierarchy.cpython-36m-aarch64-linux-gnu.so -Wl,--version-script=build/temp.linux-aarch64-3.6/link-version-scipy.cluster._hierarchy.map
building 'scipy.cluster._optimal_leaf_ordering' extension
compiling C sources
C compiler: aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
compile options: '-I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: scipy/cluster/_optimal_leaf_ordering.c
In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from scipy/cluster/_optimal_leaf_ordering.c:598:
/usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^~~~~~~
scipy/cluster/_optimal_leaf_ordering.c: In function ‘__pyx_pf_5scipy_7cluster_22_optimal_leaf_ordering_optimal_leaf_ordering.isra.58’:
scipy/cluster/_optimal_leaf_ordering.c:4747:19: warning: ‘__pyx_v_best_w’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_117 = __pyx_v_best_w;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:3414:7: note: ‘__pyx_v_best_w’ was declared here
int __pyx_v_best_w;
^~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:4746:19: warning: ‘__pyx_v_best_u’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_116 = __pyx_v_best_u;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:3413:7: note: ‘__pyx_v_best_u’ was declared here
int __pyx_v_best_u;
^~~~~~~~~~~~~~
aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.6/scipy/cluster/_optimal_leaf_ordering.o -Lbuild/temp.linux-aarch64-3.6 -o build/lib.linux-aarch64-3.6/scipy/cluster/_optimal_leaf_ordering.cpython-36m-aarch64-linux-gnu.so -Wl,--version-script=build/temp.linux-aarch64-3.6/link-version-scipy.cluster._optimal_leaf_ordering.map
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating /tmp/tmpvz7d4hd0/tmp
creating /tmp/tmpvz7d4hd0/tmp/tmpvz7d4hd0
compile options: '-I/usr/include/python3.6m -c'
extra options: '-std=c++14'
aarch64-linux-gnu-g++: /tmp/tmpvz7d4hd0/main.c
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating /tmp/tmp3j3pimiu/tmp
creating /tmp/tmp3j3pimiu/tmp/tmp3j3pimiu
compile options: '-I/usr/include/python3.6m -c'
extra options: '-std=c++14 -fvisibility=hidden'
aarch64-linux-gnu-g++: /tmp/tmp3j3pimiu/main.c
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating /tmp/tmpmxeh9kyu/tmp
creating /tmp/tmpmxeh9kyu/tmp/tmpmxeh9kyu
compile options: '-I/usr/include/python3.6m -c'
aarch64-linux-gnu-g++: /tmp/tmpmxeh9kyu/main.c
building 'scipy.fft._pocketfft.pypocketfft' extension
compiling C++ sources
C compiler: aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
creating build/temp.linux-aarch64-3.6/scipy/fft
creating build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft
compile options: '-DPOCKETFFT_PTHREADS -I/home/dlinano/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
extra options: '-std=c++14 -fvisibility=hidden'
aarch64-linux-gnu-g++: scipy/fft/_pocketfft/pypocketfft.cxx
scipy/fft/_pocketfft/pypocketfft.cxx:15:10: fatal error: pybind11/pybind11.h: No such file or directory
#include <pybind11/pybind11.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Running from scipy source directory.
/usr/local/lib/python3.6/dist-packages/numpy/distutils/system_info.py:728: UserWarning: Specified path /usr/local/include/python3.6m is invalid.
return self.get_paths(self.section, key)
error: Command "aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPOCKETFFT_PTHREADS -I/home/dlinano/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c scipy/fft/_pocketfft/pypocketfft.cxx -o build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o -MMD -MF build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-dfzx1730/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy>=1.13.3' 'scipy>=0.19.1' Check the logs for full command output.
请查看完整日志: https://drive.google.com/file/d/1gLcSq86Aic5uFoPr8k6Cp366eRB2tlfw/view?usp=sharing
这对我有用。
sudo -H pip3 install scikit-learn
这是我的完整安装脚本,用于安装依赖项的顺序。
#tensorflow - zoo
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
sudo apt-get install python3-pip
sudo -H pip3 install -U pip
sudo -H pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor==0.8.0 termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta
sudo -H pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.14.0
#Cython
sudo -H pip3 install cython
#keras-zoo
sudo apt-get install -y build-essential libatlas-base-dev gfortran
sudo -H pip3 install keras
#Pandas
sudo -H pip3 install pandas
#Scipy
sudo -H python3 -m pip install scipy==1.1.0
#Sklearn
sudo -H pip3 install scikit-learn
我在使用 Jupyter (Jetson TX2) 时遇到了问题 我检查了Jupyter使用的是哪个numpy版本。
import numpy as np
np.version.version
在我的例子中它是 1.13,尽管
$ pip3 list
向我展示了 numpy 的 1.16 版 我在这里 https://fooobar.com/questions/15251639/jupyter-notebook-picks-older-version-of-numpy
找到了解决方案查看numpy路径
print (np.__path__)
在我的例子中是 /usr/lib/python3/dist-packages
进入目录并删除旧版本 numpy
$ cd /usr/lib/python3/dist-packages $ sudo rm -r numpy
安装了相关的numpy版本
$ sudo pip install numpy==1.16.1
就这些了。