-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add Inception-V4 for Fluid #672
Conversation
… models_issues_647 Add Inception-V4 for Fluid PaddlePaddle#647
import numpy | ||
import paddle.v2 as paddle | ||
import paddle.fluid as fluid | ||
import math |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 20 移动到 line 16行之后。在 import paddle.v2 之前空一行 :https://www.python.org/dev/peps/pep-0008/#imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,以后会注意编码规范的问题
import math | ||
|
||
__all__ = ['inception_v4'] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
22 行移动到 15 行之后,并且空一行:https://www.python.org/dev/peps/pep-0008/#module-level-dunder-names
input=input, | ||
pool_size=3, | ||
pool_stride=2, | ||
# add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 50 行是否有特殊含义,如果没有则删除。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已调整代码,等下次提交修复
input=input, num_filters=96, filter_size=3, stride=2, padding=1) | ||
return fluid.layers.concat(input=[pool0, conv0], axis=1) | ||
|
||
def block1(input): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请为每一个 python函数添加docstring注释。风格可以参考 https://www.python.org/dev/peps/pep-0008/#documentation-strings
image = fluid.layers.data(name='image', shape=image_shape, dtype='float32') | ||
label = fluid.layers.data(name='label', shape=[1], dtype='int64') | ||
|
||
net = inception_v4(image, class_dim) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请参考这个例子,增加多线程/多卡部分的代码。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请问例子在哪里,能否在提供一下?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sys.exit("got NaN loss, training failed.") | ||
acc_list.append(float(acc_t)) | ||
avg_loss_list.append(float(loss_t)) | ||
break # Use 1 segment for speeding up CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 357 在models下不需要,models下都是可以完整运行的例子。请删除这一行的逻辑。
fluid.io.save_inference_model(model_save_dir, ["image"], | ||
[predict], exe) | ||
return | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
models 下都是可以直接运行的完整例子,line 367 ~ 370 不需要这部分。
对models下代码merge要求是:需要保证收敛和学习效果,但不以对齐到论文state-of-art为merge的强制要求。请问PR中的 Inception-V4 模型收敛效果如何呢?能否在comment中提供训练效果数据呢? |
|
resolve #647