visdom 制作进度条 动态显示训练进度.

visdom 显示制作进度条.

先上总进度图
在这里插入图片描述
绿色的是训练了多少轮,
蓝色的是每轮训练了多少的进度.


    def processbar(self, epoch,epochs,indeximage,totalimages,opts=None):
        win = self.cur_win.get("processbar", None) 

        bili = epoch / epochs  * 100
        imgbili = indeximage / totalimages * 100
        
        tbl_str = "<div style=\"width: 100%; background-color: #ddd;\" > "\
            "<div style=\"text-align: right;margin:5px; padding-right: 20px;height: 40px;line-height: 40px;color: white; width: "+ ('%.2f' % bili) +"%;    background-color: #4CAF50;\">"+ str(epoch) +"/"+ str(epochs) +"</div>"\
            "<div style=\"text-align: right;margin:5px; padding-right: 20px;height: 40px;line-height: 40px;color: white; width: "+ ('%.2f' % imgbili) +"%; background-color: #2196F3;\">"+ ('%.2f' % imgbili) +"%</div>"\
        "</div>"

        default_opts = { 'title': 'processbar'   }
        if opts is not None:
                default_opts.update(opts)
        if win is not None:
            self.vis.text(tbl_str, win=win, opts=default_opts)
        else:
            self.cur_win["processbar"] = self.vis.text(tbl_str, opts=default_opts)
	
def	main(): 
	 processbar(16,50, 33, 560) # 用法.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值