chainer / onnx-chainer

Add-on package for ONNX format support in Chainer
MIT License
85 stars 24 forks source link

Extended class for onnx_chainer export #246

Open yonglizhong opened 4 years ago

yonglizhong commented 4 years ago

Hi all. I've recently downloaded a Light-Head RCNN model and used it for my study project. I'm now interested in exporting as an Onnx model. Was wondering if it's feasible since the model object waits for a chainer.Chain object. My model is a Class extension of a chainer.Chain class and within it consists of also a few more chainer.Chain objects. I will attempt with it soon but would just like to ask around if anyone had the experience of just exporting the full model. Thanks

disktnk commented 4 years ago

if anyone had the experience of just exporting the full model

sorry, I haven't tried such nested model.

export requires all computational graph are connected from input to output via FunctionNode. If sub-chainer.Chain is disconnectted from main-chainer.Chain graph, it will be failed. IOW, it possible enable to export the target model if all function node are connected as one computational graph.

ref: #128

yonglizhong commented 4 years ago

I have used Chainer.Function instead of FunctionNode. Was wondering if that will be a problem?

disktnk commented 4 years ago

Almost chainer.functionss wrap chainer.FunctionNode. Users don't have to care FunctionNode is used or not in many cases. But some chainer.functions such as sign, don't break down to FunctionNode, means ONNX-Chainer cannot export model using sign.