Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Is there any function to ouput weight matrix for layers? #306

Open
zhoyifan opened this issue Jul 29, 2021 · 1 comment
Open

Is there any function to ouput weight matrix for layers? #306

zhoyifan opened this issue Jul 29, 2021 · 1 comment

Comments

@zhoyifan
Copy link

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

@fs-eire
Copy link
Contributor

fs-eire commented Sep 10, 2021

There is not such API to get weights directly as far as I know. But there are 3 ways to get them:

  1. try use onnx(python package)
  2. 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
  3. use https://github.com/lutzroeder/netron to visualize your model and dump the weights in GUI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants