[DNN] 配置之“坑王驾到”

一、TF & TensorFlow 版本配置问题

From: Keras requires TensorFlow 2.2 or higher

 

From: tensorflow 对应 的keras 版本, 版本不匹配会出现很多问题

目前已知的是: tensorflow 1.5 和 keras 2.1.4 ,

                                            1.4 和 2.1.3搭配

                                            1.3 和 2.1.2 搭配,

                                            1.2 和 2.1.1搭配。

 

通过留言得到的版本确认信息为:

                                              1.8 和 keras 2.1.5

                                              1.8 和 keras 2.1.6

                                              1.9 和 keras 2.2.0

                                              2.0 和 keras 2.2.4

 
Docker 配置参考。

 

FROM nvidia/cuda:11.0-base-ubuntu18.04

MAINTAINER gau@au.com

RUN apt-get update \
    && apt-get install -y software-properties-common python3-pip \
    && pip3 install tensorflow-gpu==1.14 \
    && pip3 install keras==2.3.1 \
    && pip3 install numpy \
    && pip3 install scikit-image

COPY ./package /package

WORKDIR "/package"

CMD ["python3", "main.py"]

 

 

 

 

 

二、get_session 不在支持

2020-08-25 07:36:59.682826: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-25 07:36:59.683641: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-08-25 07:36:59.684430: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 14249 MB memory) -> physical GPU (device: 0, name: Tesla T4, pci bus id: 0000:00:1e.0, compute capability: 7.5)
Traceback (most recent call last):
  File "hdf5_to_pb.py", line 48, in <module>
    h5_to_pb(h5_model,output_dir = output_dir,model_name = output_graph_name)
  File "hdf5_to_pb.py", line 33, in h5_to_pb
    sess = K.get_session()
  File "/usr/local/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 379, in get_session
    '`get_session` is not available '
RuntimeError: `get_session` is not available when using TensorFlow 2.0.

 

 

 

 

 

Ref: Install Tensorflow , PyTorch in Ubuntu 18.04 LTS with Cuda 9.0 for NVIDIA 1080 Ti

2020年,还是选择Cuda10以上的版本为好。

 

posted @ 2020-08-25 14:38  郝壹贰叁  阅读(231)  评论(0)    收藏  举报