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

python wrap for resize layer #1853

Closed
wants to merge 15 commits into from

Conversation

pengwangucla
Copy link
Collaborator

Does not have a test outside in v2, but it works in my code. I don't know whether I need to add it manually.

@qingqing01
Copy link
Contributor

Please refer to this PR to add the unit test.

@wangkuiyi
Copy link
Collaborator

Thanks to @pengwangucla for this PR! It would be great if we can have unit tests as well. It seems that the PR mentioned by @qingqing01 is a reference. Please let us know if we can help with the tests.

@pengwangucla
Copy link
Collaborator Author

pengwangucla commented May 3, 2017 via email

@pengwangucla
Copy link
Collaborator Author

Please refer to this PR to add the unit test.

@qingqing01 How to run the test.py file, I met this error. Is there a document for this ?

Traceback (most recent call last):
  File "python/paddle/trainer_config_helpers/tests/configs/test_smooth_l1.py", line 3, in <module>
    data = data_layer(name='input', size=300)
  File "/usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/layers.py", line 270, in wrapper
    return method(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/layers.py", line 774, in data_layer
    **ExtraLayerAttribute.to_kwargs(layer_attr))
  File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 3236, in Layer
    return layer_func(name, **xargs)
  File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 1699, in __init__
    name, 'data', size, inputs=[], device=device)
  File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 1380, in __init__
    name = MakeLayerNameInSubmodel(name)
  File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 298, in MakeLayerNameInSubmodel
    if (submodel_name is None and not g_add_submodel_suffix and
NameError: global name 'g_add_submodel_suffix' is not defined

@helinwang
Copy link
Contributor

@jacquesqiao can you take a look at this?

@qingqing01
Copy link
Contributor

@pengwangucla run the unit test as follows,

make test ARGS="-R test_layerHelpers -V"

@lcy-seso lcy-seso added this to 未支持原有功能 in V2 API Enhancement May 9, 2017
@lcy-seso lcy-seso added this to Doing in Defects board May 10, 2017
@pengwangucla
Copy link
Collaborator Author

make test ARGS="-R test_layerHelpers -V"

So someone should update the document for writing new layers to add python test.

@pengwangucla
Copy link
Collaborator Author

@qingqing01 @wangkuiyi Add python test and also add '\n' for test_config_parser since someone may not notice to have '\n' at last in the test python file.

@luotao1
Copy link
Contributor

luotao1 commented May 17, 2017

@pengwangucla The travis-ci is broken, please fix it.

@pengwangucla
Copy link
Collaborator Author

what is the pre-commit version online ? I always fail the precommit @luotao1

@pengwangucla
Copy link
Collaborator Author

@luotao1 @qingqing01 @wangkuiyi Fixed the issue

@@ -17,6 +17,8 @@
import re
import getopt

from paddle.trainer.config_parser import *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请问这个文件的修改是必须的么?

Copy link
Collaborator Author

@pengwangucla pengwangucla Jun 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@luotao1
Copy link
Contributor

luotao1 commented Nov 9, 2017

Close due to 9b54ad1

@luotao1 luotao1 closed this Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
V2 API Enhancement
未支持原有功能
Development

Successfully merging this pull request may close these issues.

None yet

6 participants