Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多余的sees.run #71

Open
sljlp opened this issue Dec 16, 2019 · 2 comments
Open

多余的sees.run #71

sljlp opened this issue Dec 16, 2019 · 2 comments

Comments

@sljlp
Copy link

sljlp commented Dec 16, 2019

请问各位,main方法中在构建网络时可以看到,attributes_w_n可以由attribute自动推理出来,
但是在train方法中为什么要多加这一步:
attributes_w_n = sess.run(list_ops['attributes_w_n_batch'],feed_dict={list_ops['image_batch']: images,list_ops['attribute_batch']: attributes})
然后在下面feed_dict中填入:
feed_dict = {
list_ops['image_batch']: images,
list_ops['landmark_batch']: landmarks,
list_ops['attribute_batch']: attributes,
list_ops['phase_train_placeholder']: True,
list_ops['euler_angles_gt_batch'] : eulers,
list_ops['attributes_w_n_batch']: attributes_w_n
}
之后才去执行其他的,然而在test方法中则没有这一步,请问,加与不加有什么区别?我对tensorflow尚不非常了解,劳烦讲一下,谢谢

@luckynote
Copy link
Collaborator

luckynote commented Dec 16, 2019 via email

@sljlp
Copy link
Author

sljlp commented Dec 16, 2019

多谢这么快回复 @luckynote
我的意思是,保留计算图中的设置而不使用run这一步,这样也可以让tensorflow在计算图中自动计算出attribute_w_n,也就是,在:
feed_dict = {
list_ops['image_batch']: images,
list_ops['landmark_batch']: landmarks,
list_ops['attribute_batch']: attributes,
list_ops['phase_train_placeholder']: True,
list_ops['euler_angles_gt_batch'] : eulers,
list_ops['attributes_w_n_batch']: attributes_w_n
}
中,去掉最后一个输入ist_ops['attributes_w_n_batch']: attributes_w_n,变为:
feed_dict = {
list_ops['image_batch']: images,
list_ops['landmark_batch']: landmarks,
list_ops['attribute_batch']: attributes,
list_ops['phase_train_placeholder']: True,
list_ops['euler_angles_gt_batch'] : eulers,
},
这样在训练代码中可以吗?
我不太明白为什么要多加一步:
attributes_w_n = sess.run(list_ops['attributes_w_n_batch'],feed_dict={list_ops['image_batch']: images,list_ops['attribute_batch']: attributes})
,而且看计算图中,要计算attribute_w_n, 并不需要image_batch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants