Open chikiuso opened 5 years ago
Hi!
Sorry for the sparse documentation.
You'll need to adjust paths in the client.py
call (as described here: https://github.com/leod/hncynic/tree/master/serve#querying). The download for the pretrained model contains a file called bpecodes.subword-nmt
, the path to this file needs to be given in the --bpe_codes
argument. Try something like this:
echo "Ask HN: What is your favorite hobby?" \
| ./client.py --host=localhost --port=9000 --model_name=hncynic --bpe_codes=trained-model-v1/bpecodes.subword-nmt
Hi @leod , thanks for your quick response! I tried it again and it shows up another error msg :
Traceback (most recent call last):
File "./client.py", line 119, in
Have you started the docker container, i.e. the call here?
If yes, please post the output from the docker container. You'll need to be careful with the -v $PWD:/models
argument, in that the mounted directory (here: pwd
) needs to contain both the batching_parameters.txt
file and the export3-sample30
directory from the pretrained model download. You'll also need to adjust the --model_base_path=/models/export1/1550276061
argument to --model_base_path=/models/export3-sample30/1555528919
.
I haven't adjusted the documentation to the paths from the pretrained model downloads, that's why a few changes in arguments are necessary here and there.
Hi @leod , thanks for your detailed explanation, I tried to run it this command :
docker run \ --rm \ -p 9000:9000 \ -v $PWD:/trained-model-v1 \ --name serving \ --entrypoint tensorflow_model_server \ tensorflow/serving:1.11.0 --enable_batching=true \ --batching_parameters_file=/trained-model-v1/batching_parameters.txt \ --port=9000 --model_base_path=/trained-model-v1/export3-sample30/1555528919 \ --model_name=hncynic
And it got the following error :
2019-09-23 02:03:17.271480: E tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:369] FileSystemStoragePathSource encountered a file-system access error: Could not find base path /trained-model-v1/export3-sample30/1555528919 for servable hncynic
Hi @leod , thanks for your quick response! I tried it again and it shows up another error msg :
Traceback (most recent call last): File "./client.py", line 119, in main() File "./client.py", line 113, in main hyps = generator(title, args.n) File "./client.py", line 62, in call result = future.result() File "/usr/local/lib/python3.7/site-packages/grpc/_channel.py", line 295, in result raise self grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses" debug_error_string = "{"created":"@1569164392.134058000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3528,"referenced_errors":[{"created":"@1569164392.134053000","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":399,"grpc_status":14}]}"
Hi, did you sovle this?I meet the same problem
Hi, @leod thanks for your generous to provide the pertained model, I tried to run it and it tells the following errors, may I ask how could I solve it? thanks :
➜ serve git:(master) ✗ echo Why I Hate Whiteboard Interviews \
> | ./client.py --host=localhost --port=9000 --model_name=hncynic \
pipe> --preprocessor=../data/preprocess.sh \
pipe> --bpe_codes=../exps/data/bpecodes/bpecodes.subword-nmt \
pipe> --postprocessor=../data/mosesdecoder/scripts/tokenizer/detokenizer.perl
Traceback (most recent call last):
File "./client.py", line 119, in <module>
main()
File "./client.py", line 113, in main
hyps = generator(title, args.n)
File "./client.py", line 62, in __call__
result = future.result()
File "/Users/haoc/Library/Python/3.8/lib/python/site-packages/grpc/_channel.py", line 744, in result
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Expects arg[0] to be string but float is provided"
debug_error_string = "{"created":"@1629428786.721098000","description":"Error received from peer ipv6:[::1]:9000","file":"src/core/lib/surface/call.cc","file_line":1070,"grpc_message":"Expects arg[0] to be string but float is provided","grpc_status":3}"
ERROR: StatusCode.INVALID_ARGUMENT
I am wondering if there is a problem with the python version?Sorry i'm not sure
Hi, thanks for your generous to provide the pertained model, I tried to run it and it tells the following errors, may I ask how could I solve it? thanks :
Traceback (most recent call last): File "./client.py", line 119, in
main()
File "./client.py", line 110, in main
bpe_codes=args.bpe_codes)
File "./client.py", line 36, in init
with open(bpe_codes) as f:
FileNotFoundError: [Errno 2] No such file or directory: '../exps/data/bpecodes'