How do I load weights of a pre-trained model?
With the recent update and also your support, I can now build and run deep neural network models. How do I load weights, biases etc. from a file so that I can use the network for classification?
Hello @mo-morikawa , it's really nice that you can run your deep network models :smile: Currently, the only way of loading the weights and biases are to load them manually, meaning that you have to open and read the values from the file and then use them to fill the tensor manually. You can use some iterators to do this easily. Have a look here for some examples on how to fill a tensor.
I think it would be useful to have a function to automate and simplify this process so we will try to have something in place for the next release.
Hello @GeorgeARM , The example you gave is just for the formulation with NHW(batch, height, width), but how about the in-out channels? Is it the (out channels, height, width, in channels) formulation? I want to know something about convolution kernel shape.
Hell @SunAriesCN,
Apologies for my late response. Convolution kernels shape is [OFM, IFM, H, W] with faster changing dimensions from right to left, where OFM are the output feature maps and IFM the input feature maps. Does this answer your question?
Latest release 17.09 adds initial support of a graph API. An example can be found here. A numpy loader is provided as well here where you can load weights dumped from caffe or tensorflow. Have a look for more details on how to do this here
Closing issue. Reopen if needed.