-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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 net specification #1733
Python net specification #1733
Conversation
This is because the constructor of |
This looks nifty. What happens with multiple tops? (e.g. in your example, can you do
I agree, there should definitely be a way to construct a pycaffe Net by passing a caffe_pb2.NetParameter thing (if you have one) rather than writing it to a file -- PRs welcome (or I'll probably try to do this at some point if nobody else does). |
Re: multiple tops, I had in mind your syntax @jeffdonahue, but I don't think I implemented it here yet. Yes, there should be a way to construct |
* A sample code was added. * `slice_dim` and `slice_point` attributes were explained.
[docs] brief explanation of SLICE layer's attributes
Correct 'epochs' to 'iterations'
Next: release candidater
fix Imagenet example path
set the right rpath for tools and examples respectively thanks for the report @mees!
[build] fix dynamic linking of tools
… was overwritten with symlink created at build time and installed with install(DIRECTORY ...)
… systems). This commit specifies Python2 with which cpp_lint.py works :-)
[cmake] fix install rpath for pycaffe
APPLE was misspelled in Line 27
fixes: cpp_lint.py fails silently with Python3
Check caffe tool runs
…b-shapes extract_features preserves feature shape
...and fix up detector quote convention.
- download CaffeNet if it isn't there - switch to caffe.Net - reshape net for single input - explain param, bias indexing - update output for N-D blobs
- N-D blob parameter dimensions - add filtering section to net surgery example - make Gaussian blur and Sobel edge kernels - alter biases - do flat assignment instead of reshape and explain memory layout - make dir for surgery files
- add a little explanation - solve from Python and the command line - time scikit-learn and caffe - fix test iterations (number of instances / batch size)
call forward to warm-start the demo so the first request isn't slow.
Update leveldb include variable name to match FindLevelDB.cmake
Pycaffe fixes and example reformation
Fixup AccuracyLayer like SoftmaxLossLayer in BVLC#1970
878044a
to
0e79cef
Compare
Closing to reopen against master. |
22ef4fe
to
23ee7ab
Compare
23ee7ab
to
cde046a
Compare
Is there a way to modify existing network from within python? Or is there a way to edit prototxt by coding instead of manully changing them? My experiment requires freezing/training different layers, how can I do this through python code? Thank you. |
Protobuf is powerful, but is not a general-purpose language, and can be cumbersome in its current use for writing down complicated chains of functions, i.e., nets. See previous discussion at (nonexhaustively) #1290 and #1169.
Python is a general-purpose language with clean syntax and an intimate relationship with Caffe. This PR allows net specification as (domain-specific) Python code (and consequently, effortless programmatic net construction).
Currently this is just a proof-of-concept sketch, which lightly sprinkles Python magic over the
caffe_pb2
protobuf interface.LeNet can be written as:
And can be instantiated via this hackiness, to be cleaned up later:
Things to think about:
Net
s directly fromLayer
s, without going through protobuf.Net
is created.Net
s rather than having to makeNet
s out of them.