djl
djl copied to clipboard
How to print model's topology and each block's input/output information (如何打印model 的网络结构)
或者获取每层网络的类型和大小 、输入和输出维度相关信息
@yanchaoguo We don't support this feature today. We had some prototype, and not mature enough to publish it.
You can manually get those information using Block API:
- Each block has inputShape and inputNames variable: https://github.com/awslabs/djl/blob/master/api/src/main/java/ai/djl/nn/AbstractBlock.java#L73-L76
- You call Block.getOutputShapes() to get output information: https://github.com/awslabs/djl/blob/master/api/src/main/java/ai/djl/nn/Block.java#L228
I think I can improve this when I refactor the initializer
We have this now since DJL 0.18.0 https://github.com/deepjavalibrary/djl/pull/1720