iperov / DeepFaceLab

DeepFaceLab is the leading software for creating deepfakes.
GNU General Public License v3.0
46.27k stars 10.38k forks source link

Can't parse "center" error immediately upon starting training #5723

Open dave-mitchell opened 10 months ago

dave-mitchell commented 10 months ago

Expected behavior

Describe, in some detail, what you are trying to do and what the output is that you expect from the program. I expect the model to begin training and building previews and models using my data_src/ and data_dst/ image data in my workspace.

Actual behavior

Describe, in some detail, what the program does instead. Be sure to include any error message or screenshots. After running extract frames, detect faces, sort, enhance, and then Xseg, I'm getting the following error when I start the training. I'm using a Colab notebook, fwiw. I edited my warp.py file as instructed by /gaurang1123 in issue 5403 but that didn't fix the issue.
Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/content/DeepFaceLab/core/joblib/SubprocessGenerator.py", line 54, in process_func gen_data = next (self.generator_func) File "/content/DeepFaceLab/samplelib/SampleGeneratorFace.py", line 136, in batch_func raise Exception ("Exception occured in sample %s. Error: %s" % (sample.filename, traceback.format_exc() ) ) Exception: Exception occured in sample 00028.jpg. Error: Traceback (most recent call last): File "/content/DeepFaceLab/samplelib/SampleGeneratorFace.py", line 134, in batch_func x, = SampleProcessor.process ([sample], self.sample_process_options, self.output_sample_types, self.debug, ct_sample=ct_sample) File "/content/DeepFaceLab/samplelib/SampleProcessor.py", line 106, in process warp_params = imagelib.gen_warp_params(resolution, File "/content/DeepFaceLab/core/imagelib/warp.py", line 137, in gen_warp_params random_transform_mat = cv2.getRotationMatrix2D((w // 2, w // 2), rotation, scale) TypeError: Can't parse 'center'. Sequence item with index 0 has a wrong type

Steps to reproduce

Describe, in some detail, the steps you tried that resulted in the behavior described above. The code to reproduce the issue is in the colab notebook for the project. Specifically the cell that's triggering the error is:

`#@title Training Model = "SAEHD" #@param ["SAEHD", "AMP", "Quick96", "XSeg"] Backup_every_hour = True #@param {type:"boolean"} Silent_Start = True #@param {type:"boolean"}

%cd "/content"

Mount Google Drive as folder

from google.colab import drive drive.mount('/content/drive')

import psutil, os, time

p = psutil.Process(os.getpid()) uptime = time.time() - p.create_time()

if (Backup_every_hour): if not os.path.exists('workspace.zip'): print("Creating workspace archive ...") !zip -0 -r -q workspace.zip workspace print("Archive created!") else: print("Archive exist!")

if (Backup_every_hour): print("Time to end session: "+str(round((43200-uptime)/3600))+" hours") backup_time = str(3600) backup_cmd = " --execute-program -"+backup_time+" \"import os; os.system('zip -0 -r -q workspace.zip workspace/model'); os.system('cp /content/workspace.zip /content/drive/My\ Drive/'); print('Backed up!') \"" elif (round(39600-uptime) > 0): print("Time to backup: "+str(round((39600-uptime)/3600))+" hours") backup_time = str(round(39600-uptime)) backup_cmd = " --execute-program "+backup_time+" \"import os; os.system('zip -0 -r -q workspace.zip workspace'); os.system('cp /content/workspace.zip /content/drive/My\ Drive/'); print('Backed up!') \"" else: print("Session expires in less than an hour.") backup_cmd = ""

cmd = "DeepFaceLab/main.py train --training-data-src-dir workspace/data_src/aligned --training-data-dst-dir workspace/data_dst/aligned --pretraining-data-dir pretrain --model-dir workspace/model --model "+Model

if Model == "Quick96": cmd+= " --pretrained-model-dir pretrain_Q96"

if Silent_Start: cmd+= " --silent-start"

if (backup_cmd != ""): train_cmd = (cmd+backup_cmd) else: train_cmd = (cmd)

!python $train_cmd`

Other relevant information