How to import a pre-trained neural network into Flux.jl ?


I’m using the Flux library in Julia. How can I import an Inception neural network into it?

I’ve seen that the following can be done in Mocha.jl to import a pre-trained net.

using HDF5 
h5open("model/bvlc_reference_caffenet.hdf5", "r") do h5
load_network(h5, net)

Is there some way I can import a pre-trained model in Flux?


What models are you looking to load?

For models you trained in Flux itself, see loading and saving models in the docs.

For models trained in other frameworks there are fewer options, though it’s not that hard to write a parser for most model formats. We have ONNX.jl, which we used to load VGG19, but it’s pretty rough around the edges right now.




I want to load the InceptionV3 model. Any way to do this?


You have two options:

(1) Write a keras model reader (which would be a great contribution!)
(2) Export the model to ONNX from keras, and then load it via ONNX.jl


Is there any documentation on using ONNX.jl to read in an onnx file into Flux?

Also, is there a way to go from flux -> onnx? (If not, I’d be interesting in working on something like this and would welcome pointers on getting started)