小编src*_*src的帖子

通过 docker 详细登录 tensorflow 服务

有没有办法通过docker在tf服务中设置日志级别?我看到这些参数,但没有看到任何关于在那里记录的信息

    --port=8500                         int32   Port to listen on for gRPC API
    --grpc_socket_path=""               string  If non-empty, listen to a UNIX socket for gRPC API on the given path. Can be either relative or absolute path.
    --rest_api_port=0                   int32   Port to listen on for HTTP/REST API. If set to zero HTTP/REST API will not be exported. This port must be different than the one specified in --port.
    --rest_api_num_threads=48           int32   Number of threads for HTTP/REST API processing. If not set, will be auto set based …
Run Code Online (Sandbox Code Playgroud)

logging tensorflow tensorflow-serving

6
推荐指数
1
解决办法
1567
查看次数

如何在张量流中连接字符串张量的张量?

我很确定我错过了一些明显的东西,但是是否不可能在张量流中加入字符串张量的一维张量?该string_join操作仅需要张量列表,我找不到将张量转换为列表的方法:

>>> x = tf.string_join(['a', 'b'], '')
>>> sess.run(x)
b'ab'
>>> x = tf.string_join(tf.constant(['a', 'b']), '')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/digitalroots/anaconda2/envs/dl/lib/python3.6/site-packages/tensorflow/python/ops/gen_string_ops.py", line 164, in string_join
    separator=separator, name=name)
  File "/home/digitalroots/anaconda2/envs/dl/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 406, in apply_op
    (input_name, op_type_name, values))
TypeError: Expected list for 'inputs' argument to 'StringJoin' Op, not Tensor("Const:0", shape=(2,), dtype=string).
Run Code Online (Sandbox Code Playgroud)

python tensorflow

3
推荐指数
1
解决办法
3356
查看次数

关于文件下载的wget和requests.get之间的区别

我有一个奇怪的错误.Dropbox上有一个文件,我正在使用以下python代码下载:

import requests
import shutil

url = 'https://www.dropbox.com/s/fgyso9fq40qp1vl/testfiles.tar.gz?dl=0'
r = requests.get(url, stream=True)
path_to_save = "/tmp/data.dload-1"
with open(path_to_save, 'wb') as f:
    shutil.copyfileobj(r.raw, f)  
Run Code Online (Sandbox Code Playgroud)

这下载到/tmp/data.dload-1.

使用wget下载的同一文件 wget https://www.dropbox.com/s/fgyso9fq40qp1vl/testfiles.tar.gz?dl=0 -O /tmp/data.dload-2

这两个文件具有相同的类型:

(dl)x:x$ file /tmp/data.dload-1 
/tmp/data.dload-1: gzip compressed data, from Unix
(dl)x:x$ file /tmp/data.dload-2 
/tmp/data.dload-2: gzip compressed data, last modified: Thu Apr 26 23:05:15 2018, from Unix
Run Code Online (Sandbox Code Playgroud)

但是没有它们会产生不同的结果:

(dl)x:x$ tar -zxvf /tmp/data.dload-1
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status …
Run Code Online (Sandbox Code Playgroud)

python wget python-requests

3
推荐指数
2
解决办法
1016
查看次数