错误展示如下:
Error:
Traceback (most recent call last):
File "E:\software\DeepFaceLab\DeepFaceLab_NVIDIA_up_to_RTX2080Ti\_internal\DeepFaceLab\mainscripts\Trainer.py", line 159, in trainerThread
model_save()
File "E:\software\DeepFaceLab\DeepFaceLab_NVIDIA_up_to_RTX2080Ti\_internal\DeepFaceLab\mainscripts\Trainer.py", line 68, in model_save
model.save()
File "E:\software\DeepFaceLab\DeepFaceLab_NVIDIA_up_to_RTX2080Ti\_internal\DeepFaceLab\models\ModelBase.py", line 393, in save
self.onSave()
File "E:\software\DeepFaceLab\DeepFaceLab_NVIDIA_up_to_RTX2080Ti\_internal\DeepFaceLab\models\Model_SAEHD\Model.py", line 759, in onSave
model.save_weights ( self.get_strpath_storage_for_file(filename) )
File "E:\software\DeepFaceLab\DeepFaceLab_NVIDIA_up_to_RTX2080Ti\_internal\DeepFaceLab\core\leras\layers\Saveable.py", line 61, in save_weights
d_dumped = pickle.dumps (d, 4)
MemoryError
解决办法:
我通过减少数据加载的 worker 数量解决了这个问题。在我的版本中,我编辑了 DeepFaceLab_NVIDIA_up_to_RTX2080Ti_internal\DeepFaceLab\models\Model_SAEHD\Model.py,只需将第 669 行更改为
cpu_count = 4 #multiprocessing.cpu_count()
我认为由于存在错误,每个 CPU 工作器都使用了太多内存(这里设置了4,可以根据自己配置来修改),因此限制它们的数量可以缓解这个问题。解决方案可能是修复 SampleGeneratorFace.py,以限制其资源使用量
文章评论