unable to install tensorflow model server - python-3.x

I am trying to deploy my model on tensorflow serving. But I am facing issue with the installation of tensorflow model server itself. Do I need to install anything else before model server can be installed? I am using python v3.6 and tensorflow version 1.12.0 currently on VM.
conda install tensorflow-model-server
pip install tensorflow-model-server
Below are the two ways using which I am trying to install:
using conda install which gives me below error.
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
tensorflow-model-server
using pip which is says:
Collecting tensorflow-model-server
Could not find a version that satisfies the requirement tensorflow-model-server (from versions: )
No matching distribution found for tensorflow-model-server

Did you try to follow instruction that are provide into documentation?
At very first, you should try to Add Tensorflow Service as package source using instructions as below
echo "deb [arch=amd64] http://storage.googleapis.com/tensorflow-serving-apt stable tensorflow-model-server tensorflow-model-server-universal" | sudo tee /etc/apt/sources.list.d/tensorflow-serving.list && \
curl https://storage.googleapis.com/tensorflow-serving-apt/tensorflow-serving.release.pub.gpg | sudo apt-key add -
# then install
apt-get update && apt-get install tensorflow-model-server
For more information, please look at link below:
Tensorflow Serving doc

Related

ERROR: No matching distribution found for catboost on ARM64 architecture

I am trying to build a multi-architecture image for ARM64 using buildx command. I am using python:3.8-slim as a base image and trying to install catboost using pip, but I am getting the following error.
ERROR
ERROR: Could not find a version that satisfies the requirement catboost==1.0.4 (from versions: none)
ERROR: No matching distribution found for catboost==1.0.4
Dockerfile
FROM --platform=linux/arm64/v8 python:3.8-slim
RUN apt update && \
apt upgrade -y && \
pip install -U pip && \
pip install --upgrade setuptools
steps...
Command
docker buildx build --platform linux/arm64 -t dockerId:test-arm -f ./dockerfiles/Dockerfile .
Alternatives I have tried
In the Dockerfile I tried using the --platform=linux/amd64 which builds the arm64 successfully but still doesn't work when I deploy it on the ARM machine.
I have used anaconda for installing the packages but the error to install catboost remains the same.
#0 122.6 PackagesNotFoundError: The following packages are not available from current channels:
#0 122.6
#0 122.6 - catboost
This is a shoutout to the #catboost team. I am currently working on a deadline and would like to know if the catboost has support for ARM64 over a docker image.

tflite_runtime get Illegal instruction on raspberry pi

after installing tflite_runtime on raspberry pi using the following commands
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install python3-tflite-runtime
and trying to import tflite .. I got "Illegal instruction"
Error screenshot
The prebuilt tflite_runtime package set from the above site does not cover armv6 architecture yet.
Alternatively, you can choose some other options.
(1) Install the TensorFlow pip package.
TensorFlow Lite features are a part of TensorFlow package and the prebuilt TensorFlow pip packages support armv6. See https://www.tensorflow.org/install/pip
(2) Build your own tflite_runtime through Bazel or CMake.
If there is a need for installing the tflite_runtime only, it is possible to build the tflite_runtime by yourself. The following document describes the differences between Bazel and CMake and how to build the tflite_runtime through them.
https://www.tensorflow.org/lite/guide/build_arm

Can't install azure cli on centos

I am trying to install azure-cli on centos 7 box. I am getting this error repeatedly
Error: Package: azure-cli-2.0.80-1.el7.x86_64 (azure-cli)
Requires: libpython3.6m.so.1.0()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I tried to execute both commands but none of these worked for me.
Acturally, Azure CLI requires python3, it's even an executable Python package azure-cli which you can find in PyPI.org. So please make sure there is a Python 3 runtime installed in your CentOS 7.
If you want to fix your issue manually, you can try to download and install the related rpm package for Libpython3.6m.so.1.0()(64bit) from https://pkgs.org/download/libpython3.6m.so.1.0()(64bit), as the figure below.
However, the best way is to follow the offical tutorial Install Azure CLI with yum to install it in CentOS 7.
Otherwise, the other solution is as below to directly install its python package via pip.
Please check whether the Python 3 runtime had been installed in CentOS 7 via command python3 -V or python -V to see the Python version or system will remind you to install it.
Please check whether the pip or pip3 command for Python 3 runtime had been installed via pip3 -V or pip -V to see the pip version or system will remind you to install it.
Completed the two steps above, you can easily to install azure-cli via command sudo pip3 install azure-cli or sudo pip install azure-cli, it will help to install azure-cli to the system path, then you can try to use it via az --version.
You can install it by mentioning the repo/package URL
sudo yum install https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.38.0-1.el7.x86_64.rpm
packages can be found here https://packages.microsoft.com/yumrepos/azure-cli/

Unable to find libssl.so.1.0.2 and libssl.so.1.0.2 when trying to use PyODBC on a Docker image

I have a docker file which uses python:3 (based on debian). I am installing the drivers for PyODBC as per the microsoft docs.
FROM python:3
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install msodbcsql17 unixodbc-dev -y
I can build the image, but when trying to run it I get the error: Can't open lib /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
I have ran: ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1 and get the output that says the below two libs cannot be found:
libcrypto.so.1.0.2 => not found
libssl.so.1.0.2 => not found
I have also tried dpkg --search libssl and dpkg --search libsslcrypto which yielded:
libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
From ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1 there are other libraries being picked up in /usr/lib/x86_64-linux-gnu/
Very new to docker/linux, so how can I install libcrypto.so.1.0.2 and libssl.so.1.0.2 or downgrade the versions in '/usr/lib/x86_64-linux-gnu/' so that they can be used for msodbcsql17 (have tried apt get -y install libssl1.0=1.0.2) ?
The docker image python:3 appears to be built on Debian 10.
The package repository you are installing appears to be built for Debian 9, and does not appear to be compatible with Debian 10.
You should probably be using the repository with packages built for Debian 10 to get compatible packages.

Python 3.6 in tensorflow gpu docker images

How can I have python3.6 in tensorflow docker images.
All the images I tried (latest, nighty) are using python3.5 and I don't want to modify all my scripts.
The Tensorflow images are based on Ubuntu 16.04, as you can see from the Dockerfile. This release ships with Python 3.5 as standard.
So you'll have to re-build the image, and the Dockerfile will need editing, even though you need to do the actual build with the parameterized_docker_build.sh script.
This answer on ask Ubuntu covers how to get Python 3.6 on Ubuntu 16.04
The simplest way would probably be just to change the From line in the Dockerfile to FROM ubuntu:16.10, and python to python3.6 in the initial apt-get install line
Of course, this may break some other Ubuntu version-specific thing, so an alternative would be to keep Ubuntu 16.04 and install one of the alternative ppa's also listed in the linked answer:
RUN add-apt-repository ppa:deadsnakes/ppa &&
apt-get update &&
apt-get install -y python3.6
Note that you'll need this after the initial apt-get install, because that installs software-properties-common, which you need to add the ppa.
Note also, as in the comments to the linked answer, that you will need to symlink to Python 3.6.
Finally, note that I haven't tried any of this. The may be gotchas, and you may need to make another change to ensure that the correct version of Python is used by the running container.
You can use stable images which are supplied by third parties, like ufoym/deepo.
One that fits TensorFlow, python3.6 and cuda10 can be found here or you can pull it directly using the command docker pull ufoym/deepo:py36-cu100
I use their images all the time, never had problems
With this anwer, I just wanted to specify how I solved this problem (the previous answer of SiHa helped me a lot but I had to add a few steps so that it worked completly).
Context:
I'm using a package (segmentation model for unet++) that requires tensorflow==1.4.0 and keras==2.2.2.
I tried to use the docker image for tensorflow 1.4.0, however, the default version of python of this image is 3.5 which is not compatible with my package.
I managed to install python3.6 on the docker images thanks to the following files:
My Dockerfile contains the following lines:
Dockerfile:
FROM tensorflow/tensorflow:1.4.0-gpu-py3
RUN mkdir /AI_PLATFORM
WORKDIR /AI_PLATFORM
COPY ./install.sh ./install.sh
COPY ./requirements.txt ./requirements.txt
COPY ./computer_vision ./computer_vision
COPY ./config.ini ./config.ini
RUN bash install.sh
Install.sh:
#!/urs/bin/env bash
pip install --upgrade pip
apt-get update
apt-get install -y python3-pip
add-apt-repository ppa:deadsnakes/ppa &&
apt-get update &&
apt-get install python3.6 --assume-yes
apt-get install libpython3.6
python3.6 -m pip install --upgrade pip
python3.6 -m pip install -r requirements.txt
Three things are important:
use python3.6 -m pip instead of pip, else the packages are installed on python 3.5 default version of Ubuntu 16.04
use docker run python3.6 <command> to run your containers with python==3.6
in the requirements.txt file, I had to specify the following things:
h5py==2.10.0
tensorflow-gpu==1.4.1
keras==2.2.2
keras-applications==1.0.4
keras-preprocessing==1.0.2
I hope that this answer will be useful
Maybe the image I created will help you. It is based on the cuda-10.0-devel image and has tensorflow 2.0a-gpu installed.
You can use it as base image for your own implementation. The image itself doesn't do anything. I put the image on dockerhub https://cloud.docker.com/repository/docker/patientzero/tensorflow2.0a-gpu-py3.6
The github repo is located here: https://github.com/patientzero/tensorflow2.0-python3.6-Docker
Pulling it won't do much, but for completeness:
$ docker pull patientzero/tensorflow2.0-gpu-py3.6
edit: changed to general tensorflow 2.0x image.
Also as mentioned here, the official image for the beta 2.0 release now comes with python 3.6 support

Resources