Closed HunterHantao closed 4 years ago
@HunterHantao,
We don't support general converter.
However, for your specific model solution is not complicated for converting the weights from C++ to Python: read model in C++, take all underlying parameters arrayfire arrays, save them using http://arrayfire.org/docs/group__stream__func__save.htm and then use python ArrayFire to read into numpy with http://arrayfire.org/arrayfire-python/arrayfire.array.html?highlight=to_ndarray#arrayfire.array.Array.to_ndarray.
Hope this is answering your question and needs.
Thank you very much. We will try to use it this way.
@HunterHantao were you able to export weigths of trained model ?
I do not have a very nice way to do it. Instead, I just print out the weight and save them in txt. Later, I use python parse it.
https://github.com/facebookresearch/wav2letter/blob/master/src/common/FlashlightUtils.cpp#L16 Add this after Line 16 af::print("Weights", p.array());
That's a nice hack. So finally were you able to recreate the ASR architecture in pytorch and run that successfully ?
I am using Tensorflow, and yes. Finally, it work well there. I am able to load the weights to tensorflow.
Is there a way that we can export the trained model weights? For example, export the weights to numpy /pytorch dictionary format.