wkentaro / pytorch-fcn

PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CPU memory usage is high

LiheYoung opened this issue · comments

The cpu memory usage is high when training on Cityscapes. I didn't crop the image, and input size is 1024x2048. Larger size may lead to higher GPU memory usage but my GPU memory usage is okay(around 11G), the cpu memory usage is high(around 80%). Sometimes it may be killed because it cannot allocate memory.

Maybe this visualized image is too large in your case?

if len(visualizations) < 9:
viz = fcn.utils.visualize_segmentation(
lbl_pred=lp, lbl_true=lt, img=img, n_class=n_class)
visualizations.append(viz)

Those visualized images are tiled to create another large image.

out = osp.join(self.out, 'visualization_viz')
if not osp.exists(out):
os.makedirs(out)
out_file = osp.join(out, 'iter%012d.jpg' % self.iteration)
skimage.io.imsave(out_file, fcn.utils.get_tile_image(visualizations))