i also meet the memory leak problem. but i dont know how to correct it…
Traceback (most recent call last):
  File "main_multi_model_test.py", line 169, in <module>
    main()
  File "main_multi_model_test.py", line 143, in main
    val_loss, val_acc, val_bacc = validate(model, val_loader, criterion, taskNum, weights=attrWeights)
  File "../validate.py", line 30, in validate
    for i, (inputs, labels) in enumerate(val_loader):
  File "/home/user1/miniconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 193, in __iter__
    return _DataLoaderIter(self)
  File "/home/user1/miniconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 469, in __init__
    w.start()
  File "/home/user1/miniconda3/lib/python3.7/multiprocessing/process.py", line 112, in start
    self._popen = self._Popen(self)
  File "/home/user1/miniconda3/lib/python3.7/multiprocessing/context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/home/user1/miniconda3/lib/python3.7/multiprocessing/context.py", line 277, in _Popen
    return Popen(process_obj)
  File "/home/user1/miniconda3/lib/python3.7/multiprocessing/popen_fork.py", line 20, in __init__
    self._launch(process_obj)
  File "/home/user1/miniconda3/lib/python3.7/multiprocessing/popen_fork.py", line 70, in _launch
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory