0

我目前正在尝试构建一个 docker 容器,它应该能够在 Xavier AGX 之上运行 GPU 加速的 tensorflow。
我的方法源自示例和官方 nvidia 文档jetson-tensorflow

我的 Dockerfile 看起来像这样:

FROM nvcr.io/nvidia/l4t-base:r32.4.2

WORKDIR /

RUN apt update && apt install -y --fix-missing make g++

RUN apt update && apt install -y --fix-missing python3-pip libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev libjpeg8-dev liblapack-dev libblas-dev gfortran python3-h5py

RUN pip3 install -U pip testresources setuptools cython 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 pybind11

RUN pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow

COPY requirements.txt .

RUN pip3 install -r requirements.txt

COPY . .

CMD ["python3", "-u", "app.py"]

但是,我收到了这些与 h5py 相关的错误:

In file included from /tmp/pip-build-cdi1gcqf/h5py/h5py/defs.c:654:0:
    /tmp/pip-build-cdi1gcqf/h5py/h5py/api_compat.h:27:10: fatal error: hdf5.h: No such file or directory
     #include "hdf5.h"

添加时

HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/

在安装 h5py 之前,我成功并进入了安装 tensorflow 的阶段。
但是,然后 tensorflow 安装 h5py==2.10.0 再次出现错误:

error libhdf5.so: No such file or Directory

Xavier 的 JetPack 版本是 4.4,l4t 版本是 32.4.2
任何帮助将不胜感激!

最好的问候多米尼克

4

1 回答 1

0

解决方案是改变:

h5py==2.9.0h5py==2.10.0

在第一个安装命令中。

以下 Dockerfile 有效:

FROM nvcr.io/nvidia/l4t-base:r32.4.2

WORKDIR /

RUN apt update && apt install -y --fix-missing make g++

RUN apt update && apt install -y --fix-missing python3-pip libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev libjpeg8-dev liblapack-dev libblas-dev gfortran python3-h5py

RUN HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip3 install -U pip testresources setuptools cython numpy==1.16.1 future==0.17.1 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.0.5 keras_applications==1.0.8 gast==0.2.2 pybind11

RUN pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow

COPY requirements.txt .

RUN pip3 install -r requirements.txt

COPY . .

CMD ["python3", "-u", "app.py"]
于 2020-08-21T12:01:40.557 回答