简体   繁体   English

Nvidia Jetson 上 Docker 和 Tensorflow 的 h5py 问题

[英]h5py problem with Docker and Tensorflow on Nvidia Jetson

I am currently trying to build a docker container which should be able to run GPU accelerated tensorflow on top of a Xavier AGX.我目前正在尝试构建一个 docker 容器,它应该能够在 Xavier AGX 之上运行 GPU 加速 tensorflow。
My approach is derived from example and the official nvidia documentation jetson-tensorflow .我的方法源自示例和官方 nvidia 文档jetson-tensorflow

My Dockerfile looks like this:我的 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"]

However, I am getting these errors, related to the h5py:但是,我收到了这些与 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"

When adding添加时

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

before installing h5py, I succeed and get to the stage where it installs tensorflow.在安装 h5py 之前,我成功并进入了安装 tensorflow 的阶段。
However, then tensorflow installs h5py==2.10.0 where again I get an error:但是,然后 tensorflow 安装 h5py==2.10.0 再次出现错误:

error libhdf5.so: No such file or Directory

The JetPack version of the Xavier is 4.4 and the l4t version is 32.4.2 Xavier的JetPack版本是4.4,l4t版本是32.4.2
Any help would be highly appreciated!任何帮助将不胜感激!

Best regards Dominik最好的问候多米尼克

The solution was to change:解决方案是改变:

h5py==2.9.0 to h5py==2.10.0 h5py==2.9.0h5py==2.10.0

in the first installation command.在第一个安装命令中。

The following Dockerfile works:以下 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"]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM