xwying / torchshow

Visualize PyTorch tensors with a single line of code.
MIT License
647 stars 10 forks source link

torchshow.save memory problem #6

Closed Z-MU-Z closed 2 years ago

Z-MU-Z commented 2 years ago

Hi, i meet this warning when i use torchshow to save masks in 'for' loop. Is there anyway to solve this problem?

envs/py38/lib/python3.8/site-packages/torchshow/visualization.py:108: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (matplotlib.pyplot.figure) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam figure.max_open_warning). fig, axes = plt.subplots(nrows=nrows, ncols=ncols, squeeze=False)

xwying commented 2 years ago

Hi, it seems like you are using an older version of torchshow. Can you try to install the new version and see if it resolve the problem?

Z-MU-Z commented 2 years ago

Thanks a lot! it works!