当前位置:网站首页>tqdm的多行显示与单行显示
tqdm的多行显示与单行显示
2022-07-02 07:44:00 【lanmy_dl】
引入
from tqdm import tqdm
pbar = tqdm(total=n_batches)
单行显示
缺点,看不到变化的过程,因为会覆盖掉;优点,节省屏幕,看的舒心
for 循环取数据过程
pbar.set_description('Train loss: %.3f / loss %.3f' % (train_loss / (i + 1), loss.item()))
pbar.update()
pbar.close()
好比
多行显示
不关闭close()就是多行显示
for 循环取数据过程
pbar.set_description('Train loss: %.3f / loss %.3f' % (train_loss / (i + 1), loss.item()))
pbar.update()
补充完整循环
上面的循环就是train里面取每个数据来训练的循环,常用是这样
for i,(img, label) in enumerate(train_loader):
pbar.set_description('Train loss: %.3f / loss %.3f' % (train_loss / (i + 1), loss.item()))
pbar.update()
pbar.close() # 如果单行显示这行没有
边栏推荐
- Why does LabVIEW lose precision in floating point numbers
- 金山云——2023届暑期实习
- Special topic of binary tree -- acwing 18 Rebuild the binary tree (construct the binary tree by traversing the front and middle order)
- TIPC messaging3
- 一招快速实现自定义快应用titlebar
- PCL point cloud to depth image
- Special topic of binary tree -- acwing 19 The next node of the binary tree (find the successor of the node in the tree)
- Jsp webshell Free from killing - The Foundation of JSP
- Use Huawei performance management service to configure the sampling rate on demand
- I STM32 development environment, keil5/mdk5.14 installation tutorial (with download link)
猜你喜欢
TIPC messaging3
MongoDB 学习整理(条件操作符,$type 操作符,limit()方法,skip() 方法 和 sort() 方法)
Special topic of binary tree -- acwing 1497 Traversal of the tree (use post and mid order traversal to build a binary tree)
Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
How to use ide to automatically sign and debug Hongmeng application
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?
JVM之垃圾回收器
Internship report skywalking distributed link tracking?
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
2022-06-17
随机推荐
QT learning diary 8 - resource file addition
TIPC addressing 2
全网显示 IP 归属地,是怎么实现的?
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
二叉树专题--AcWing 1497. 树的遍历(利用后、中序遍历,构建二叉树)
Flick two open, realized a batch lookup join (with source code)
Jsp webshell Free from killing - The Foundation of JSP
软件产品管理系统有哪些?12个最佳产品管理工具盘点
二叉树专题--AcWing 3540. 二叉搜索树建树(实用板子 构建二叉搜索树 并输出前、中、后序遍历)
From Read and save in bag file Jpg pictures and PCD point cloud
[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
TIPC Service and Topology Tracking4
Use Huawei performance management service to configure the sampling rate on demand
Thanos Receiver
TIPC protocol
QT learning diary 7 - qmainwindow
V2x SIM dataset (Shanghai Jiaotong University & New York University)
LabVIEW为什么浮点数会丢失精度
Appgallery connect scenario development practice - image storage and sharing
Hdu1228 a + B (map mapping)