在setup.py文件中,我们通常会放置以下内容
install_requires=["numpy>=1.11.2", "scipy>=0.17.1"]
这样,在运行命令python setup.py install时,依赖项就会自动安装。
然而,我无法使它与tensorflow一起工作。我试图将tensorflow>=1.0.1或tensorflow-gpu>=1.0.1和其他一些组合放在一起,但我总是得到相同的错误消息:
error: Could not find suitable distribution for Requireme
我正在尝试用Tensorflow在Google中实现Tensorflow的语音合成,使用这个代码在Github中形成一个,下面是我的代码,直到使用localhost服务器为止,我如何在Google的笔记本上运行本地主机服务器?
我的代码:
!pip install tensorflow==1.3.0
import tensorflow as tf
print("You are using Tensorflow",tf.__version__)
!git clone https://github.com/keithito/tacotron.git
cd tacotron
pip
我来到周围,对开发人员试图使tensorflow目录看起来像实际的软件包,而实际的软件包根目录实际上是tensorflow/python的做法感到非常失望。通过使用表单的__init__.py文件
from tensorflow.python import *
del python
他们试图实现这一目标。这会导致在使用包时出现一些不一致的行为(至少在我看来是这样)。
import tensorflow.python # seems to work
tensorflow.python # AttributeError: n
我是TensorFlow的乞丐,我对如何在google中部署我的代码有一些疑问。
我在本地的机器上运行了de retrain.py,我用自己的照片训练了“盗梦空间”。我有图表(.pb和.meta)。之后,我开发了另一个python脚本来测试我的模型。就像这样:
import tensorflow as tf, sys
# change this as you see fit
image_path = sys.argv[1]
# Read in the image_data
image_data = tf.gfile.FastGFile(image_path, 'rb').r
我有一个ps任务服务器和两个worker任务服务器的分布式设置。每一个都在CPU上运行。我异步地运行了下面的示例,但它不能同步工作。我不确定我是否在代码中做错了什么:
import math
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
# Flags for defining the tf.train.ClusterSpec
tf.app.flags.DEFINE_string("ps_hosts", "",
Tensorflow translate.py示例的代码translate.py使我感到困惑。复制的代码是:
# This is a greedy decoder - outputs are just argmaxes of output_logits.
outputs = [int(np.argmax(logit, axis=1)) for logit in output_logits]
为什么argmax能工作?
output_logits的形状是[bucket_length,batch_size,embedding_size]。
我的问题是,将TensorFlow.js计算(使用@tensorflow/tfjs-node)移动到Node.js中的工作线程是否是一个好主意。这个问题归结为在使用本机后端运行TensorFlow计算时主线程被阻塞的程度的问题。
据我所知,如果我使用完全JavaScript版本的TensorFlow (@tensorflow/tfjs)并调用model.fit(x, y, options),符合模型的计算实际上是在主JavaScript线程上进行的。更准确地说,model.fit返回一个Promise,因此计算是在微任务中异步执行的,但是这些任务仍然运行在主线程上。这些微任务在某种意义上是阻塞