-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Model zoo (fix #3) #110
Model zoo (fix #3) #110
Conversation
'chainer.optimizers', | ||
'chainer.requirements', | ||
'chainer.utils'], | ||
package_data={'chainer.requirements': ['cuda-requirements.txt']}, | ||
install_requires=['numpy', | ||
'protobuf', |
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.
Can we install protobuf
in py3 environment?
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.
We can install it. CI passed it, too.
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.
OK, no problem.
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.
Which version of protobuf is required?
Do you have a unit test for this function? |
I'm thinking about the test, though I have no good plan, yet. |
I'll write an example of loading and using a Caffe reference model. |
I added an example. However, it outputs too low accuracy. I will try to resolve this issue. |
return decorator | ||
|
||
|
||
class CaffeFunction(function.Function): |
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.
How does this function behave when backward
is called?
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.
This function just inserts a computational graph on top of the given variables in __call__
, instead of inserting itself into the graph. Backward computation is done by each node in this graph, so CaffeFunction itself does not need to handle the backward.
I updated the example code. |
I updated the code. It achieves the same accuracy as the original Caffe implementation. (Actually I've fixed testing mode and RGB order) |
Please |
|
||
|
||
parser = argparse.ArgumentParser( | ||
descriptor='Download a Caffe reference model') |
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.
s/descriptor/description/
|
||
.. note:: | ||
|
||
This function only supports Python 2.7, since the compiled module for |
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.
What happens on py3?
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.
I changed the code to raise an exception in Python 3. I also wrote this behavior in the docstring.
I added a warning routine on unknown layer types. |
I load my caffemodel and then Traceback ZeroDivisionError as: File "", line 1, in |
@itortoise Thank you for reporting an error. Would you open another issue for this? |
@itortoise #148 may fix your problem. |
Implement cumprod function
This PR fixes #3 by adding functions.caffe.CaffeFunction, which loads a pretrained Caffe model and emulates its subnetwork. The usage is written in the reference documentation, though I also show it here. This is an example of loading BVLC reference CaffeNet and computes
fc8
blob fromdata
blob.The inputs dict describes how to initialize the blobs by variables. The outputs list indicates which blobs to be output as variables. Also user can extracts parameterized layers from CaffeFunction.fs, which is a FunctionSet object containing Linear or Convolution2D objects.