bert-serving-start: command not found...解决过程

最近在做一个问答系统,大概思路是先将问题encode为一个向量,然后在问题库中进行比较,选取最接近的问题,将其答案返回给客户端

模型中主要的部分在于基于BERT模型,需要将问题先embedding,用到了xiaohan博士的bert as service项目,这个项目目前可以直接pip install bert-serving-service 安装,在win10上可以正常使用,在结合aiohttp作为服务端后需要将其放在服务器上

目前环境配置如下,

Description: Ubuntu 17.10
Python 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import tensorflow as tf
tf.version
'1.8.0'

但是发现git clone项目后报错bert-serving-start: command not found...

发现没有bert-serving-start 这个命令,于是搜一下...

发现这个命令在/home/liujiefei/.local/bin/bert-serving-start 这个地方 很奇怪

然后继续执行命令,

发现tf版本要求1.10,这里只有1.8,所以再升级一下,结束并查看

注意一般情况下可以直接bert-serving-start -model_dir /home/liujiefei/pythonworkspace/06bertserver/02bertapp/chinese_L-12_H-768_A-12 -num_worker=4 启动服务

但是有时候需要用python3来启动服务

python3 bert-serving-start -model_dir /home/liujiefei/pythonworkspace/06bertserver/02bertapp/chinese_L-12_H-768_A-12 -num_worker=4

到这里,我的问题以经解决了,xiaohan的github上的issus没有出现这种情况,看到有人在centos上这样解决的,不知道是怎么处理的

这个项目最初就是mac开发的,后来为了兼容windows操作系统,现在开发到bert-serving-service bert-serving-client直接pip安装就可以在win10运行,可能是ubuntu上出的问题吧,

python start-bert-as-service.py -model_dir /scratch2/NAACL2018/test/english_L-12_H-768_A-12/ -num_worker=4
/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值