2017年12月12日星期二

ubuntu安装python3.6

ubuntu14.04/16.04安装python3.6:
http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
sudo update-alternatives --config python3

2017年12月8日星期五

可用性和可靠性区别

可用性根据系统正常运行时间 / 总时间来度量。

可靠性是指系统可以无故障地持续运行,根据时间间隔来度量。一个例子:如果系统在每小时崩溃1ms,那么它的可用性就超过99.9999%,但是它还是高度不可靠。

2017年11月29日星期三

centos防火墙

centos增加防火墙规则:
getenforce
firewall-cmd --state
firewall-cmd --add-service mongodb
firewall-cmd --add-port 27017/tcp
firewall-cmd --add-port 27017/tcp --permanent

2017年11月17日星期五

tensorflow serving的问题

用1.2.0或者以上tensorflow版本训练导出的模型,使用serving 0.6.0版本编译出的tensorflow_model_server有问题,如果代码中有用到beam search decode时运行tensorflow_model_server加载模型会报错:Not found: Op type not registered 'GatherTree'。

但是通过apt-get install的1.3.0或者1.4.0版本的tensorflow_model_server,在我的台式机上加载几十个模型就卡死,应该是个bug。用我之前旧版本编译出来的model_server就没有这种问题。

最早的时候我用的是 636e05b2d90feb7d868e29e23861e0a530e51682 到这个commit的master分支的代码编译出来的不会出现上述两种问题,注意在编译的时候加上编译参数:bazel build -c opt --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-O3 tensorflow_serving/model_servers:tensorflow_model_server
否则编译出来的tensorflow_model_server计算特别慢,cpu占用也很高。

2017年11月8日星期三

linux shell中获取正在执行脚本的路径

script_path=$(cd `dirname $0`; pwd)
cd ${script_path}
显示的就是正在执行的脚本所在的文件夹的绝对路径

2017年11月2日星期四