xinntao / ESRGAN

ECCV18 Workshops - Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution. The training codes are in BasicSR.
https://github.com/xinntao/BasicSR
Apache License 2.0
5.91k stars 1.05k forks source link

生成lmdb文件时出现了除0的错误 #47

Closed adaxidedakaonang closed 5 years ago

adaxidedakaonang commented 5 years ago

问题出现在progress_bar.py文件中的update函数fps = self.completed / elapsed这里elapsed变成零了。我把elapsed = time.time() - self.start_time中的两个值打印出来发现是一样的: Read images... [ ] 0/36352, elapsed: 0s, ETA: Start... 1554711715.5890906 1554711715.5890906 0.0 Traceback (most recent call last): File "create_lmdb.py", line 22, in pbar.update('Read {}'.format(v)) File "D:\code\BasicSR\codes\utils\progress_bar.py", line 43, in update fps = self.completed / elapsed ZeroDivisionError: float division by zero 其中我的路径设置是这样的: img_folder = 'D:\code\BasicSR\codes\data\HR\*.png' lmdb_save_path = 'D:\code\BasicSR\codes\data\HR.lmdb' 需要您的帮助!谢谢

adaxidedakaonang commented 5 years ago

抱歉这个问题应该在BasicSR中

xinntao commented 5 years ago

If the problem arises from the pbar, you can just comment these lines, which will not influence its function.

adaxidedakaonang commented 5 years ago

It works, thank you.感谢