腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
3
回答
为什么
我们
需
要在
TensorFlow
中
使用
"
assign
“?
python
、
tensorflow
我看到了以下的操作顺序: import
tensorflow
as tf inc_v1 = v1.
assign
(v1+1)s = tf.Session()s.run(inc_v1) 结果,
我们
得到了: array([1., 1., 1.], dtype=
浏览 25
提问于2019-02-21
得票数 4
1
回答
理解
Tensorflow
控件依赖关系
python
、
tensorflow
、
machine-learning
、
controls
我正试图更好地掌握
TensorFlow
。我偶然发现了控制依赖的概念。据我所知,
我们
指定的操作顺序与执行期间的
Tensorflow
并没有真正的关系。为了优化执行速度,
TensorFlow
决定了自己计算节点的顺序。但是
我们
可以
使用
tf.control_dependencies定制执行顺序。我无法理解该功能的用例。举个例子:x = tf.Variable(5)
assign
= tf.<em
浏览 0
提问于2019-03-11
得票数 10
回答已采纳
2
回答
tf.constant有多恒定?
python
、
tensorflow
、
tensorflow2.0
StackOverFlow问题,您不能更改tf.constant,但当我这样做时,它可以完美地运行: >>>c = tf.constant([2])>>>print(c) [3]
为什么
会这样呢
浏览 25
提问于2020-03-30
得票数 2
回答已采纳
1
回答
ValueError:在
assign
_add()
中
,形状必须是等号的
tensorflow2.0
、
valueerror
我正在读 in TF2:w = tf.constant([1, 2, 3, 4], tf.float32,a new value to the variable with `
assign
()` or a related method.v.
assign
_add(tf.constant另外,
为什么
下面的返回为false?tf.shape(v) == tf.shape(tf.const
浏览 5
提问于2019-11-20
得票数 1
4
回答
为什么
我们
要在
Tensorflow
中
命名变量?
python
、
tensorflow
在一些地方,我看到了语法,其中变量用名称初始化,有时没有名字。例如:var = tf.Variable(0, name="counter") one = tf.constant(1)
浏览 1
提问于2015-11-11
得票数 41
回答已采纳
1
回答
如何在
tensorflow
中
使用
notop层进行微调并定义自己的输入图像大小
tensorflow
、
keras
有许多关于如何
使用
tensorflow
进行微调的示例。几乎所有这些例子都试图将
我们
的图像调整到现有模型所需的指定大小。例如,224×224是vgg19所
需
的输入大小。但是,在keras
中
,
我们
可以通过将include_top设置为false来更改输入大小: base_model = VGG19(include_top=False, weights="imagenet", input_shape=(input_size, input_size, input_channe
浏览 1
提问于2017-11-03
得票数 1
1
回答
为什么
我需
要在
TensorFlow
中
初始化变量?
python
、
variables
、
tensorflow
、
machine-learning
、
artificial-intelligence
我主要是在R
中
开发我的模型,我目前正在学习
TensorFlow
。() if raw_data[i] - raw_data[i-1] > 5: updater.eval() tf.
assign
(spike, False).eval() print("Spike", spike.ev
浏览 5
提问于2018-01-01
得票数 7
回答已采纳
1
回答
学习和机器学习的流动
machine-learning
、
deep-learning
、
scikit-learn
、
tensorflow
我们
可以
使用
TensorFlow
进行机器学习和深度学习。那么,
为什么
我们
要在
机器学习而不是
TensorFlow
中
使用
scikit呢? 他们都是彼此的替代品吗?
浏览 0
提问于2021-08-15
得票数 0
回答已采纳
1
回答
为什么
我们
要在
tensorflow
中
构建变量字典
python
、
dictionary
、
tensorflow
在一个示例代码
中
,我看到人们在
tensorflow
中
构建变量(权重/偏差)的字典。
浏览 17
提问于2017-08-04
得票数 2
1
回答
Session.run()如何选择要运行的子图
python
、
variables
、
tensorflow
、
graph
、
variable-assignment
我试图了解Session.run()是如何在
Tensorflow
流
中
工作的。我知道Session.run()运行
我们
给它的"fetch“参数指定的子图。假设
我们
比较了这段代码的输出:
assign
1 = tf.
assign
(x, 13) print(
浏览 0
提问于2018-01-26
得票数 1
回答已采纳
1
回答
错误:模块'
tensorflow
._api.v2.train‘没有属性'GradientDescentOptimizer’解决方案是什么
python
、
tensorflow
、
tensorflow2.0
import
tensorflow
as tfunknownvalue = tf.Variable(0.0) tf.print(init) tf.print(solving) 代码是从他的
tensorflow
库中用新版本编写的,程序因为这个错误而不能运行,它是AttributeError:模块'
tensorflow
.
浏览 52
提问于2020-07-08
得票数 1
回答已采纳
1
回答
关于张量流
中
函数
assign
_add()的混淆
python
、
tensorflow
您能解释一下如何在tf.
assign
_add中
使用
新值更新变量吗?例如,在以下代码
中
: v = tf.get_variable("v", shape=(2, 1), initializer=tf.zeros_initializer()) assignment = v.
assign
_add(2) 由于
assign
_add的文档字符串表示要将参数value (在本例
中
为2 )添加到变量
中
,因此我希望v将更新为数组[2,2]。shape=(2, 1) dt
浏览 19
提问于2019-05-02
得票数 0
回答已采纳
1
回答
永久更新
tensorflow
-java
中
的变量(在推理期间)
java
、
python
、
variables
、
tensorflow
我已经
使用
python-
tensorflow
训练了一个模型,我想在java-
tensorflow
中进行推断。我已经将训练好的模型/图加载到Java
中
。在此之后,我想永久更新图中的一个变量。我知道python
中
的tf.variable.load(value,session)函数可以用来更新变量的值。我想知道Java
中
是否有类似的方法。 到目前为止,我已经尝试了以下几种方法。fetch调用期间对variableName
使用
updatedTensorValue。g.
浏览 0
提问于2018-04-13
得票数 3
1
回答
TensorFlow
是否可以自动将操作调度到所有可用GPU?
gpu
、
tensorflow
、
deep-learning
我们
已经阅读了
TensorFlow
关于调度的论文。它可以预先执行Graph并找到“正确的”设备来放置操作。但是
我们
已经测试了
使用
tf.Session(config=tf.ConfigProto(log_device_placement=True)),并且没有指定任何要运行的设备。
我们
发现所有的操作都放在第一个GPU上。Variable也被放置在图形处理器
中
。我保证现在的调度器还不够好,用户的最佳实践是
我们</em
浏览 16
提问于2016-08-04
得票数 3
回答已采纳
1
回答
它总是需
要在
Keras之前安装
TensorFlow
吗?
为什么
?
tensorflow
、
keras
https://www.pyimagesearch.com/2016/11/14/installing-keras-with-
tensorflow
-backend/ 它似乎在Keras之前安装了
TensorFlow
据我所知,这是因为
我们
可以指定CPU或GPU参数进行安装。 在你看来,是否总是需
要在
Keras之前安装
TensorFlow
?
为什么
? 此时,我直接安装了Keras,如下图所示。我得到了
TensorFl
浏览 47
提问于2020-07-02
得票数 0
回答已采纳
16
回答
为什么
我不能导入
Tensorflow
.contrib --我得到一个名为'
tensorflow
.python.saved‘的没有模块的错误
python
、
tensorflow
嗨,我刚在我的Mac上安装了
Tensorflow
,我想
使用
tf.contrib.slim,但是当我
使用
它时,我得到了这个 文件"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/
tensorflow
_
浏览 0
提问于2019-03-09
得票数 51
1
回答
X=x+1的流等效
tensorflow
所以我尝试了以下几种方法tf.
assign
(x, tf.add(x,1))x = tf.Variable(0.10, tf.float32您知道
我们
如何在
TensorFlow
中
执行这样的功能吗?完整代码sess = tf.InteractiveSession()y = tf.constant它只是确保您拥有x =
浏览 3
提问于2016-11-12
得票数 1
回答已采纳
1
回答
InvalidArgumentError:输入.与预期的float_ref不兼容
tensorflow
以下代码导致一个非常无用的错误:with tf.Session(2 节点
Assign
_1的
tensorflow
.python.framework.errors_impl.InvalidArgumentError:输入0是从与预期float_re
浏览 0
提问于2018-03-25
得票数 2
2
回答
当我
使用
tensorflow
ops编写函数时会发生什么?
python
、
tensorflow
我用
tensorflow
ops编写了一个函数。我知道,当我运行这个函数时,它会把很多操作添加到图中。但我对如何进入这些行动感到困惑。例如: with tf.name_scope('zheng'): b = tf.placeholder(tf.float32, shape=())
浏览 1
提问于2018-09-03
得票数 1
回答已采纳
1
回答
当我尝试在tensorlflow
中
运行代码时,我得到了这个错误。我该如何解决这个问题呢?
tensorflow
ImportError: cannot import name 'abs'pip uninstall
tensorflow
protobuf--yes 现在错误是相同的。
浏览 0
提问于2018-08-06
得票数 1
点击加载更多
相关
资讯
TensorFlow入门必看:Google AI实习生经验谈
令人困惑的TensorFlow!
2.2tf基础(一)——3种张量(常量、变量与占位符)的基本使用
在C+中使用TensorFlow训练深度神经网络
如何仅使用TensorFlow C+来训练深度神经网络
热门
标签
更多标签
云服务器
对象存储
ICP备案
云点播
语音识别
活动推荐
运营活动
广告
关闭
领券