Is there any function to ouput weight matrix for layers?
zhoyifan opened this issue · comments
Just like this function in tensorflow.
https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer#get_weights
https://js.tensorflow.org/api/latest/#tf.layers.Layer.getWeights
There is not such API to get weights directly as far as I know. But there are 3 ways to get them:
- try use onnx(python package)
- use protobuf library to read from a ONNX model. The protobuf def file is at https://github.com/onnx/onnx/blob/master/onnx/onnx.proto3
- use https://github.com/lutzroeder/netron to visualize your model and dump the weights in GUI.