-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
PythonLayer takes parameters by string #2871
Conversation
@philkr have you adapted this test to Python 3 already? |
4130028
to
bd788bd
Compare
|
||
|
||
def python_net_file(): | ||
f = tempfile.NamedTemporaryFile(delete=False) |
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.
NamedTemporaryFile
is created with mode='w+b'
by default, which in python3 is a buffer, not a string. To fix this just call NamedTemporaryFile(mode='w+', delete=False)
.
The python3 error is easy to fix (see above). I have no idea why python2 fails on those warnings... |
@shelhamer @philkr Thank you so much for taking care of my previous PR! Other than this, I still have a bunch of PRs for python that are not finished. If I need to update and polish them, please let me know. |
According to this post in Stack Overflow, maybe we have to include |
Hmm, the branch CI had passed but this is an issue. I'll try to fix it shortly. |
bd788bd
to
9742bec
Compare
@jeffdonahue @longjon does anybody have a favorite name or is |
I think |
245f920
to
39794ed
Compare
I changed the name of the property to |
input: 'data' input_shape { dim: 10 dim: 9 dim: 8 } | ||
layer { type: 'Python' name: 'mul10' bottom: 'data' top: 'mul10' | ||
python_param { module: 'test_python_layer_with_param_str' | ||
layer: 'SimpleParamLayer' param_str: "10" } } |
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.
Could we be consistent with single-quotes here?
Looks good except as noted. |
39794ed
to
a756cfe
Compare
Thanks for the glance @longjon. Fixed and merging. |
[pycaffe] PythonLayer takes parameters by string
Cherry-picking of the PythonLayer string parameter from #2001 by @tnarihi to give
PythonLayer
aparam_str
member for passing parameters through thepython_param
proto message.This is a simple change in itself that leaves the choice of what and how to parameterize open.
There is no automatic
eval