Tuesday, January 9, 2018

nvidia-docker-mod-python_2.7 for squeezedet

# Docker file below

$ docker build -t nvidia-docker-mod-tensorflow_2_7  --build-arg USER_ID=`id -u $USER` .
$ nvidia-docker run -it -u app -v ~/squeezeDet:/squeezeDet nvidia-docker-mod-tensorflow_2_7  bash
app@63bce0603d4c:/notebooks$ cd /squeezeDet/
app@63bce0603d4c:/squeezeDet$ touch t
app@63bce0603d4c:/squeezeDet$ ls t
t
app@63bce0603d4c:/squeezeDet$ ls 
LICENSE  README  README.md  data  requirements.txt  scripts  src  t
app@63bce0603d4c:/squeezeDet$ python src/demo.py
2018-01-17 05:30:43.253638: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2018-01-17 05:30:43.253659: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2018-01-17 05:30:43.253664: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2018-01-17 05:30:43.253668: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-01-17 05:30:43.253672: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2018-01-17 05:30:43.380710: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:893] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-01-17 05:30:43.380934: I tensorflow/core/common_runtime/gpu/gpu_device.cc:955] Found device 0 with properties:
name: GeForce GTX 1060 6GB
major: 6 minor: 1 memoryClockRate (GHz) 1.7845
pciBusID 0000:01:00.0
Total memory: 5.93GiB
Free memory: 5.55GiB
2018-01-17 05:30:43.380948: I tensorflow/core/common_runtime/gpu/gpu_device.cc:976] DMA: 0
2018-01-17 05:30:43.380953: I tensorflow/core/common_runtime/gpu/gpu_device.cc:986] 0:   Y
2018-01-17 05:30:43.380959: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1045] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0)
Image detection output saved to ./data/out/out_sample.png
app@63bce0603d4c:/squeezeDet$



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dockerfile


# docker build -t nvidia-docker-mod-tensorflow_2_7  --build-arg USER_ID=`id -u $USER` .
#
# nvidia-docker run -it -v ~/squeezedet:/squeezedet nvidia-docker-mod-python_3.5 bash


FROM gcr.io/tensorflow/tensorflow:latest-gpu

# By default, Docker containers run as the root user. This is bad because:
#   1) You're more likely to modify up settings that you shouldn't be
#   2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user

# ***
# Do any custom logic needed prior to adding your code here
# ***

# install python
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get -yqq install python3.5
RUN apt-get -yqq install python3-pip
RUN apt-get -yqq install pandoc
RUN apt-get -yqq install graphviz
RUN apt-get -yqq install python-opencv

# Install app dependencies
RUN pip install --upgrade pip

# Misc. install
RUN apt-get -yqq install git

# Install Python packages
RUN pip install Cython
RUN pip install gensim
RUN pip install h5py
RUN pip install ioutils
RUN pip install matplotlib
RUN pip install numpy
RUN pip install opencv-python
RUN pip install pandas
RUN pip install pillow
RUN pip install pydot
RUN pip install pydot-ng
RUN pip install pypandoc
RUN pip install pandoc
RUN pip install seaborn
RUN pip install sklearn
RUN pip install tensorflow-gpu

RUN pip install keras
RUN pip install keras_diagram
RUN pip install opencv-python
RUN pip install easydict
RUN pip install joblib

# Python 2.7 GPU support

# select a url to install based on your version requirements
# https://www.tensorflow.org/install/install_linux#the_url_of_the_tensorflow_python_package

#ENV tfBinaryURL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp35-cp35m-linux_x86_64.whl

ENV tfBinaryURL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp27-none-linux_x86_64.whl

RUN pip install --upgrade $tfBinaryURL

ARG USER_ID
RUN useradd --shell /bin/bash -o --create-home --user-group -u $USER_ID  app

ENV SQDT_ROOT=/squeezeDet

# Change to the user.
USER app


#
# ENV DATA_USER=depappas
#
# ENV DATA_GROUP=depappas
#
# RUN chmod -R 700 ${SQDT_ROOT}
#
# RUN groupadd -r ${DATA_GROUP} \
#   && useradd -r -g ${DATA_GROUP} ${DATA_USER}
# RUN mkdir -p ${SQDT_ROOT} \
#   && chown -R ${DATA_GROUP}:${DATA_USER} ${SQDT_ROOT}
# VOLUME ${SQDT_ROOT}
#
# # Change to the app user.
# USER ${DATA_USER}

No comments:

Post a Comment