通过 APT 安装旧版本的 tensorflow-model-server

通过 APT 安装旧版本的 tensorflow-model-server

日前,谷歌发布了软件包 [1]1.4.0的新版本 ( ) tensorflow-model-server。Tensorflow 模型服务器可以通过 APT [2] 安装。

我遵循了他们的安装说明:

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 -
sudo apt-get update

但是,我需要安装以前的版本(1.3.0)。apt-cache show tensorflow-model-server仅显示我的 Ubuntu 16.04 上的最新版本:

Package: tensorflow-model-server                                                                       
Version: 1.4.0                                                                                         
Architecture: all                                                                                      
Maintainer: TensorFlow Serving team                                                                    
Priority: optional                                                                                     
Section: contrib/devel                                                                                 
Filename: pool/tensorflow-model-server/t/tensorflow-model-server/tensorflow-model-server_1.4.0_all.deb 
Size: 74107364                                                                                         
SHA256: 3892446a6b0e1c2e8354df72c9ba7c662c533cc1b4477ee74872b39436892fef                               
SHA1: 87c961db61e5fc7fe6c7fc3b65e2882ceb06833d                                                         
MD5sum: f7d4d26d7bf2b5c2fcaf8e83f85ed77c                                                               
Description: TensorFlow Serving ModelServer                                                            
Description-md5: 9b7e03f5296f318009581d6e285e2f89                                                      
Homepage: https://github.com/tensorflow/serving                                                        
Built-Using: Bazel  

因此安装失败:

$ apt-get install tensorflow-model-server=1.3.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '1.3.0' for 'tensorflow-model-server' was not found

有没有办法强制 APT 安装以前的版本?还是我必须手动下载软件包deb

[1]https://www.tensorflow.org/serving/

[2]https://www.tensorflow.org/serving/setup#installing_using_apt-get

答案1

wget 'http://storage.googleapis.com/tensorflow-serving-apt/pool/tensorflow-model-server/t/tensorflow-model-server/tensorflow-model-server_1.3.0_all.deb'
dpkg -i tensorflow-model-server_1.3.0_all.deb

您可以查看可用的版本https://storage.googleapis.com/tensorflow-serving-apt

答案2

正如之前的评论所述,通过 WGET 下载版本并在本地安装是完全可行的:

wget 'http://storage.googleapis.com/tensorflow-serving-apt/pool/tensorflow-model-server/t/tensorflow-model-server/tensorflow-model-server_1.3.0_all.deb'
dpkg -i tensorflow-model-server_1.3.0_all.deb

您也可以在容器内执行相同操作。

例如,这个 Dockerfile 将在一个小的容器中安装包

FROM python:3.7.13-slim-bullseye
RUN  apt-get update \
  && apt-get install -y wget

RUN wget 'http://storage.googleapis.com/tensorflow-serving-apt/pool/tensorflow-model-server/t/tensorflow-model-server/tensorflow-model-server_1.3.0_all.deb' --no-verbose
RUN apt install ./tensorflow-model-server_1.3.0_all.deb

您可以在这里找到您需要的所有版本:发布

相关内容