草庐IT

tensorflow_serving

全部标签

python - 拟合 TensorForestEstimator 时 TensorFlow 崩溃

我正在尝试使用代表7个特征和7个标签的数值float据来拟合TensorForestEstimator模型。也就是说,features和labels的形状都是(484876,7)。我在ForestHParams中适本地设置了num_classes=7和num_features=7。数据格式如下:f1f2f3f4f5f6f7l1l2l3l4l5l6l739000.0120.065.01000.025.00.693.9439000.039959.042099.046153.049969.054127.055911.032000.0185.065.01000.075.00.462.19320

python - 在同一个 GPU 上运行多个 tensorflow 进程不安全吗?

我只有一个GPU(TitanXPascal,12GBVRAM),我想在同一个GPU上并行训练多个模型。我尝试将我的模型封装在一个python程序(称为model.py)中,并在model.py中包含代码以限制VRAM使用(基于thisexample)。我能够在我的GPU上同时运行多达3个model.py实例(每个实例占用的VRAM略低于33%)。奇怪的是,当我尝试使用4个模型时,我收到了一个错误:2017-09-1013:27:43.714908:Etensorflow/stream_executor/cuda/cuda_dnn.cc:371]couldnotcreatecudnnha

python - 记录由 tensorflow 服务模型服务的请求

我已经使用tesnorflow服务构建了一个模型,并使用以下命令在服务器上运行它:-bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server--port=9009--model_name=ETA_DNN_Regressor--model_base_path=//apps/node-apps/tensorflow-models-repository/ETA但现在此屏幕停滞不前,没有提供有关传入请求和响应的任何信息。我尝试使用TF_CPP_MIN_VLOG_LEVEL=1标志。但现在它提供了如此多的输出,但仍然没有

python - AttributeError: 模块 'tensorflow' 没有属性 'python'

>importtensorflow>importtensorflow.contrib>tensorflow.contribmodule'tensorflow.contrib'from'D:\\ProgramData\\Anaconda3\\lib\\site-packages\\tensorflow\\contrib\\__init__.py'>importtensorflow.python>tensorflow.pythonTraceback(mostrecentcalllast):File"",line1,inAttributeError:module'tensorflow'has

python - 在默认情况下不创建新范围的情况下,如何在 tensorflow 中重用变量范围?

我在图表的一部分创建了一个变量范围,稍后在图表的另一部分我想将OP添加到现有范围。这相当于这个提炼的例子:importtensorflowastfwithtf.variable_scope('myscope'):tf.Variable(1.0,name='var1')withtf.variable_scope('myscope',reuse=True):tf.Variable(2.0,name='var2')print([n.namefornintf.get_default_graph().as_graph_def().node])产生:['myscope/var1/initial_v

python - 导入错误 : No module named 'tensorflow.python' with tensorflow-gpu

我想为keras/tensorflow提供gpu支持,这就是我安装tensorflow-gpu的原因。所以我通过pip安装了tensorflow-gpu:pipinstall--upgradetensorflow-gpu这导致:fromkerasimportbackendasKK.tensorflow_backend._get_available_gpus()>[]然后我找到thisstackoverflowanswer这说明我应该在安装tensorflow-gpu后卸载tensorflow。这导致:UsingTensorFlowbackend.--------------------

python - Tensorflow 的 Between-graph replication 是数据并行的一个例子吗?

我已阅读distributedtensorflowdocumentation和thisanswer.根据this,在数据并行方法中:Thealgorithmdistributesthedatabetweenvariouscores.Eachcoreindependentlytriestoestimatethesameparameter(s)Coresthenexchangetheirestimate(s)witheachothertocomeupwiththerightestimateforthestep.在模型并行方法中:Thealgorithmsendsthesamedatatoa

python - tensorflow 警告 : The graph couldn't be sorted in topological order?

当我运行tensorflow训练(使用自定义图形,闭源)时,它输出警告:2018-10-0314:29:24.352895:Etensorflow/core/grappler/optimizers/dependency_optimizer.cc:666]Iteration=0,topologicalsortfailedwithmessage:Thegraphcouldn'tbesortedintopologicalorder.这是什么意思?什么可能导致此问题以及如何避免?更新:作为记录,在我的例子中,尽管有这个警告,tensorflow仍然可以正常工作。所以我认为这只是意味着计算图中的

python - 使用 SignatureDefs 将 api 端点映射到特定方法的 TensorFlow Serving 模型保存下来?

我最近浏览了thistutorial.我有教程中的训练模型,我想用docker为它提供服务,这样我就可以向它发送任意字符串并从模型中获取预测结果。我也经历了thistutorial了解如何使用docker服务。但是我不明白模型是如何保存的并具有接受输入参数的能力。例如:curl-d'{"instances":[1.0,2.0,5.0]}'\-XPOSThttp://localhost:8501/v1/models/half_plus_two:predicthalf_plus_two模型如何知道如何处理instances参数?在文本生成教程中,有一个名为generate_text的方法可

python - 多 GPU/Tower 设置 Tensorflow 1.2 Estimator

我想将我的_model_fnforEstimator变成多GPU解决方案。有没有办法在EsitmatorAPI中执行此操作,或者我是否必须明确编码设备放置和同步。我知道我可以使用tf.device('gpu:X')将我的模型放在GPUX上。我还知道我可以遍历可用的GPU名称来跨多个GPU复制我的模型。我还知道我可以为多个GPU使用单个输入队列。我不知道哪些部分(优化器、损失计算)实际上可以转移到GPU以及我必须在哪里同步计算。根据Cifar10示例,我认为我只需要同步梯度。特别是在使用的时候train_op=tf.contrib.layers.optimize_loss(loss=lo