-
Notifications
You must be signed in to change notification settings - Fork 171
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 script for accuracy validation #11
Conversation
E.g. to verify the fit_a_line model conversion, run
and get the output
|
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 think this is really well done.
"--fluid_model", | ||
required=True, | ||
help="The path to PaddlePaddle Fluid model.") | ||
parser.add_argument( |
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 know one is input and the other is output, but in #9, this arg is named --onnx_model_dir
. Let's just make it consistent
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. I will modify the argument in #9
|
||
import paddle.fluid as fluid | ||
from onnx import helper, checker, load | ||
from caffe2.python.onnx.backend import Caffe2Backend |
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.
Should we add the requirement for this in our requirements.txt
?
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.
Caffe2 cannot be installed by pip
and its installation is not that direct without Anaconda 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.
Got it, just add some notes to the README then
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
for var_name in feed_target_names | ||
] | ||
input_shapes = [ | ||
shape if shape[0] > 0 else (args.batch_size, ) + shape[1:] |
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.
Does this use paddle_onnx_shape
or is this completely different
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.
paddle_onnx_shape
only changes the unknown dim from -1 to 0 (required by ONNX). And this line is used to set the batch size.
Excellent Job. Some questions:
|
|
Hey @kuke, isnt there an FC in fluid? http://paddlepaddle.org/docs/develop/api/fluid/en/layers.html#permalink-36-fc. Is this actually not an op? |
@varunarora No. The |
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.
LGTM
add pylint code style check
Resolve #5
To run this validation script, need to install Caffe2 to use its ONNX backend for the backend in the onnx/onnx repo has a bug when executing
run_model()
. And at the same time, need to install the latest ONNX from source, otherwise some other problems will happen.