1.设置超级用户root的账户密码
参考:https://www.cnblogs.com/mmdln/p/9071525.html
2.卸载Ubuntu Desktop自带的不必要软件
参考:https://www.jianshu.com/p/67a86505279f
3.用Xshell远程访问Ubuntu服务器
sudo apt-get install openssh-server
4.关闭开机时的提示“System program problem detected”
参考:https://blog.csdn.net/sinat_33718563/article/details/80310004
5.解决sudo apt-get update引起的问题“Problem executing scripts APT::Update::Post-Invoke-Success”
sudo pkill -KILL appstreamcli
wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
6.修改软件镜像源
参考:https://blog.csdn.net/m0_43394876/article/details/88751825
注意事项:1)修改sources.list前,务必备份sources.list。2)在vim的命令模式下,用ndd命令可以快速删除当前光标行及其之后的n-1行的内容。
7.安装docker
参考:https://blog.csdn.net/jinking01/article/details/82490688
1)给普通用户添加docker权限
sudo groupadd docker #添加docker用户组
sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组
newgrp docker #更新用户组
2)开机自启docker的命令
systemctl enable docker
3)如需加速pull的下载速度,可以更改docker的镜像源
vi /etc/docker/daemon.json
{
"registry-mirrors":["https://pee6w651.mirror.aliyuncs.com"]
}
systemctl restart docker.service
8.安装Java环境
参考:https://www.cnblogs.com/ZeroTensor/p/10162022.html
通过以下命令可以让root用户获取Java环境
sudo ln -s /usr/local/java/jdk1.8.0_241/bin/jar /bin/jar
sudo ln -s /usr/local/java/jdk1.8.0_241/bin/java /bin/java
sudo ln -s /usr/local/java/jdk1.8.0_241/bin/javac /bin/javac
sudo ln -s /usr/local/java/jdk1.8.0_241/bin/javah /bin/javah
sudo ln -s /usr/local/java/jdk1.8.0_241/bin/javadoc /bin/javadoc
9.Tensorflow Serving模型部署案例
参考:
https://blog.csdn.net/weixin_40922744/article/details/102872607
https://www.jianshu.com/p/d673c9507988
https://blog.csdn.net/zhou_438/article/details/103427853
https://blog.csdn.net/jeffery0207/article/details/86072456
创建提供服务的容器
docker run -p 8501:8501 --mount type=bind,source=/home/myroot/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu,target=/models/half_plus_two -e MODEL_NAME=half_plus_two -t tensorflow/serving '&'
虚拟机IP地址192.168.133.129,远程(Windows、Linux均可)访问
curl -XPOST http://192.168.133.129:8501/v1/models/half_plus_two:predict -d "{\"instances\":[1.0, 2.0, 5.0]}"