Use Slim to overview model in Tensorflow like model.summary() in Keras
to in Tensorflow use model Keras like Summary
2023-09-27 14:24:26 时间
model.summary() in Tensorflow like Keras
Use Slim
Example:
import numpy as np from tensorflow.python.layers import base import tensorflow as tf import tensorflow.contrib.slim as slim x = np.zeros((1,4,4,3)) x_tf = tf.convert_to_tensor(x, np.float32) z_tf = tf.layers.conv2d(x_tf, filters=32, kernel_size=(3,3)) def model_summary(): model_vars = tf.trainable_variables() slim.model_analyzer.analyze_vars(model_vars, print_info=True) model_summary()
Output:
--------- Variables: name (type shape) [size] --------- conv2d/kernel:0 (float32_ref 3x3x3x32) [864, bytes: 3456] conv2d/bias:0 (float32_ref 32) [32, bytes: 128] Total size of variables: 896 Total bytes of variables: 3584
相关文章
- Leetcode: Minimum Moves to Equal Array Elements
- How to handle uncaught exception in Blazor project globally?
- The three top-paying tech roles in 2022 and the skills you need to land them
- Can't connect to localhost, but can with computer name in SQL Server 2008
- 数据库根据两列数据得到层级关系SQL Queries to Manage Hierarchical or Parent-child Relational Rows in SQL Server
- Do I have to return something in javascript function?
- JQuery: Convert GET URL to POST
- mysql客户端(Navicat)远程登录操作遇到问题1142 - XXX command denied to ×××
- 【LeetCode-面试算法经典-Java实现】【129-Sum Root to Leaf Numbers(全部根到叶子结点组组成的数字相加)】
- Mina 中遇到SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
- 【英文讲座】Paradigm Shift to Enterprise In-Memory Database Era...
- c语言找不到静态库文件,[C语言] 解决引用openssl静态库libcrypto.a和libssl.a出现undefined reference to错误的问题...
- $route(to, from)
- Convert string to binary and binary to string in C#
- 分享某Python下的mpi教程 —— A Python Introduction to Parallel Programming with MPI 1.0.2 documentation
- gevent.hub.BlockingSwitchOutError: Impossible to call blocking function in the event loop callback
- Android Call to ‘Thread.sleep()‘ in a loop, probably busy-waiting Inspection info:
- Redis_MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk问题解决
- 九度OJ #1437 To Fill or Not to Fil
- mysqldump导出报错“mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table
- How to install Mysql in the CentOS
- 15 Linux Split and Join Command Examples to Manage Large Files--reference
- C#-How to use less than sign and greater than sign symbols in xml query?
- 错误:ORA-28547:connection to server failed, probable Oracle Net admin error的解决方案
- error: Error trying to parse settings: Unexpected trailing characters in PackagesUserPreferences.sublime-settings:9:2 reloading settings Packages/User/Preferences.sublime-settings
- leetcode 538. Convert BST to Greater Tree 把二叉搜索树转换为累加树(简单)