用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月17日星期五
2017年10月27日星期五
tensorflow serving 运算特别慢
之前从源码编译的方式安装了tensorflow serving,但是部署到线上发现特别吃cpu,并且速度很慢。根据https://github.com/tensorflow/serving/issues/456,猜测应该是编译选项设置的问题。
后来换成了通过apt-get安装方式的二进制文件,问题解决。
后来换成了通过apt-get安装方式的二进制文件,问题解决。
2017年8月1日星期二
tensorflow-gpu import tensorflow的一个问题
ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory
是因为没有设置LD_LIBRARY_PATH环境变量,在~/.bashrc中添加export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64,解决。
是因为没有设置LD_LIBRARY_PATH环境变量,在~/.bashrc中添加export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64,解决。
2017年7月20日星期四
centos安装tensorflow serving
https://gist.github.com/jarutis/6c2934705298720ff92a1c10f6a009d4
自己怕安装各种库麻烦,直接运行了上面的部分脚本,除了bazel和tensorflow serving是自己安装之外,其他依赖直接按照脚本顺序运行的。
自己怕安装各种库麻烦,直接运行了上面的部分脚本,除了bazel和tensorflow serving是自己安装之外,其他依赖直接按照脚本顺序运行的。
2017年2月9日星期四
tensorflow serving 0.5.0新特性
tensorflow serving 0.5.0中使用的tensorflow版本为0.12.0。
0.5.0的tensorflow_model_server默认从use_saved_model=false变为了use_saved_model=true,注意这个问题。
SessionBundle已经过时,在后面的tensorflow serving 1.0版本中官方将不再支持。
0.5.0的tensorflow_model_server默认从use_saved_model=false变为了use_saved_model=true,注意这个问题。
SessionBundle已经过时,在后面的tensorflow serving 1.0版本中官方将不再支持。
tensorflow serving server运行时SSE4.1不支持的问题
tensorflow serving 0.5.0版本,编译成功后,运行tensorflow_model_server后报错:
2017-02-08 22:06:49: F external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:35] The TensorFlow library wa
s compiled to use SSE4.1 instructions, but these aren't available on your machine.
Aborted (core dumped)
查了相关issue:https://groups.google.com/a/tensorflow.org/forum/#!msg/discuss/qCbVWKa4GU0/6PC3x8TtEQAJ
http://stackoverflow.com/questions/41474136/disable-sse4-1-when-compiling-tensorflow/41477681#41477681
解决方法:
删除serving/tensorflow/tensorflow/tensorflow.bzl文件中的if_x86(["-msse4.1"]) + 这行
2017-02-08 22:06:49: F external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:35] The TensorFlow library wa
s compiled to use SSE4.1 instructions, but these aren't available on your machine.
Aborted (core dumped)
查了相关issue:https://groups.google.com/a/tensorflow.org/forum/#!msg/discuss/qCbVWKa4GU0/6PC3x8TtEQAJ
http://stackoverflow.com/questions/41474136/disable-sse4-1-when-compiling-tensorflow/41477681#41477681
解决方法:
删除serving/tensorflow/tensorflow/tensorflow.bzl文件中的if_x86(["-msse4.1"]) + 这行
2017年2月7日星期二
tensorflow serving运行tensorflow/configure的问题
tensorflow serving 0.5.0版本,运行configure时报错:
java.lang.RuntimeException: Unrecoverable error while evaluating node 'REPOSITORY_DIRECTORY:@jpeg' (requested by nodes 'RE
POSITORY:@jpeg')
参考了https://github.com/tensorflow/serving/issues/301
解决:
apt-get install ca-certificates-java
update-ca-certificates -f
如果还没有解决,把bazel升级到0.4.4
java.lang.RuntimeException: Unrecoverable error while evaluating node 'REPOSITORY_DIRECTORY:@jpeg' (requested by nodes 'RE
POSITORY:@jpeg')
参考了https://github.com/tensorflow/serving/issues/301
解决:
apt-get install ca-certificates-java
update-ca-certificates -f
如果还没有解决,把bazel升级到0.4.4
2017年1月13日星期五
tensorflow将SparseTensor转为Tensor
一个例子:
a = tf.SparseTensor(indices=[[0, 0], [1, 2]], values=[1, 2], shape=[3, 4])
b = tf.sparse_tensor_to_dense(a, default_value = 0, name = 'xxx')
a = tf.SparseTensor(indices=[[0, 0], [1, 2]], values=[1, 2], shape=[3, 4])
b = tf.sparse_tensor_to_dense(a, default_value = 0, name = 'xxx')
订阅:
博文 (Atom)