草庐IT

nvidia-tensorflow

全部标签

python - 属性错误 : module 'tensorflow' has no attribute 'reset_default_graph'

我已经安装了tensorflow版本r0.11。在我的文件名cartpole.py中,我导入了tensorflow:importtensorflowastf并使用它:tf.reset_default_graph()尝试在PyCharm中运行我的项目时出现此错误:intf.reset_default_graph()AttributeError:module'tensorflow'hasnoattribute'reset_default_graph'我该如何修复这个错误? 最佳答案 此功能已弃用。请改用tf.compat.v1.rese

python - Tensorflow 动态循环神经网络 (LSTM) : how to format input?

我得到了这种格式的一些数据和以下详细信息:person1,day1,feature1,feature2,...,featureN,labelperson1,day2,feature1,feature2,...,featureN,label...person1,dayN,feature1,feature2,...,featureN,labelperson2,day1,feature1,feature2,...,featureN,labelperson2,day2,feature1,feature2,...,featureN,label...person2,dayN,feature1,fe

python - 如何从 Tensorflow 中的 .pb 模型获取权重

我训练了一个模型,然后通过卡住该模型创建了一个.pb文件。所以,我的问题是如何从.pb文件中获取权重,或者我必须为获取权重做更多的过程@mrry,请指导我。 最佳答案 让我们首先从.pb文件加载图表。importtensorflowastffromtensorflow.python.platformimportgfileGRAPH_PB_PATH='./model/tensorflow_inception_v3_stripped_optimized_quantized.pb'#pathtoyour.pbfilewithtf.Sess

python - 在 TensorFlow 中关闭服务器

当我们要使用分布式TensorFlow时,我们会使用创建一个参数服务器tf.train.Server.join()但是,除了杀死进程之外,我找不到任何关闭服务器的方法。join()的TensorFlow文档是Blocksuntiltheserverhasshutdown.Thismethodcurrentlyblocksforever.这让我很烦恼,因为我想创建许多服务器用于计算,并在一切完成后关闭它们。是否有可能的解决方案。谢谢 最佳答案 您可以通过使用session.run(dequeue_op)而不是server.join()

python - 在 TensorFlow 中合并字符串张量

我处理大量的dtype="str"数据。我一直在尝试构建一个简单的图表,如https://www.tensorflow.org/versions/master/api_docs/python/train.html#SummaryWriter.对于一个简单的操作,我想使用placeholder将字符串连接在一起,如(Howtofeedaplaceholder?)有谁知道如何将字符串张量合并在一起?importtensorflowastfsess=tf.InteractiveSession()withtf.name_scope("StringSequence")asscope:left=t

python - 导入错误 : Failed to import any qt binding, Python-Tensorflow

我正在开始我的Tensorflow冒险之旅。我认为我已正确安装所有内容,但在运行此代码时,PyCharm返回错误:Traceback(mostrecentcalllast):File"C:/Users/tymot/Desktop/myenv3/env/Tensorflow/all_good.py",line15,inimportmatplotlib.pyplotaspltFile"C:\Users\tymot\Anaconda1\lib\site-packages\matplotlib\pyplot.py",line115,in_backend_mod,new_figure_manag

python - Tensorflow slim 预训练 alexnet

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭4年前。ImprovethisquestionTensorflowslim库为alexnet提供了图形结构,但它似乎没有提供预训练(在Imagenet上)的alexnet检查点(https://github.com/tensorflow/models/tree/master/research/slim)。有没有为TF-slim提供预训练的alexnet检查点?

python - 如何使用 Tensorflow 模型进行预测?

我已经创建了tensorflow程序来获取外汇的收盘价。我已经成功地创建了预测,但未能理解预测future值(value)的方法。看下面是我的预测函数:test_pred_list=[]deftestAndforecast(xTest1,yTest1):#test_pred_list=0truncated_backprop_length=3withtf.Session()assess:#train_writer=tf.summary.FileWriter('logs',sess.graph)tf.global_variables_initializer().run()counter=0

python - 与 Tensorflow 中的常规 LSTMCell 相比,使用 CudnnLSTM 训练时的不同结果

我正在使用Python中的Tensorflow训练LSTM网络,并想切换到tf.contrib.cudnn_rnn.CudnnLSTM以加快训练速度。我做的是替换cells=tf.nn.rnn_cell.LSTMCell(self.num_hidden)initial_state=cells.zero_state(self.batch_size,tf.float32)rnn_outputs,_=tf.nn.dynamic_rnn(cells,my_inputs,initial_state=initial_state)与lstm=tf.contrib.cudnn_rnn.CudnnLST

python - 在 Tensorflow 中更改变量的初始值设定项

我有一个预定义的代码可以创建一个Tensorflow图。变量包含在变量作用域中,每个变量都有一个预定义的初始值设定项。有什么办法可以改变变量的初始值设定项吗?例子:第一张图定义withtf.variable_scope('conv1')w=tf.get_variable('weights')稍后我想修改变量并将初始值设定项更改为Xavier:withtf.variable_scope('conv1')tf.get_variable_scope().reuse_variable()w=tf.get_variable('weights',initializer=tf.contrib.lay