If I understand your issue correctly, commenting this line:
vec = rescale_intensity(plt.imread(osp.join('/home/XXX', vector))/255)

yields normal behavior, while keeping it increases the memory?
How did you define rescale_indensity?
@nile649
Your projects were running fine and now after changing the storage you are noticing an increasing memory usage? Did you change something else (PyTorch version etc.)?