Can't parse 'center'. Sequence item with index 0 has a wrong type #72

Closed
opened 2022-02-05 13:05:42 +01:00 by mateuspestana · 3 comments
mateuspestana commented 2022-02-05 13:05:42 +01:00 (Migrated from github.com)

Hi! When I train my model, I'm getting this error:

   raise Exception ("Exception occured in sample %s. Error: %s" % (sample.filename, traceback.format_exc() ) )
Exception: Exception occured in sample /Users/mateuspestana/Downloads/DeepFaceLab_MacOS/workspace/data_dst/aligned/03987.jpg. Error: Traceback (most recent call last):
  File "/Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/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 "/Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/DeepFaceLab/samplelib/SampleProcessor.py", line 106, in process
    warp_params = imagelib.gen_warp_params(resolution,
  File "/Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/DeepFaceLab/core/imagelib/warp.py", line 146, 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

Does anyone knows how to solve it?
Oh, I'm using an M1 Pro.

Hi! When I train my model, I'm getting this error: ``` raise Exception ("Exception occured in sample %s. Error: %s" % (sample.filename, traceback.format_exc() ) ) Exception: Exception occured in sample /Users/mateuspestana/Downloads/DeepFaceLab_MacOS/workspace/data_dst/aligned/03987.jpg. Error: Traceback (most recent call last): File "/Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/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 "/Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/DeepFaceLab/samplelib/SampleProcessor.py", line 106, in process warp_params = imagelib.gen_warp_params(resolution, File "/Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/DeepFaceLab/core/imagelib/warp.py", line 146, 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 ``` Does anyone knows how to solve it? Oh, I'm using an M1 Pro.
chychkan commented 2022-02-11 23:17:01 +01:00 (Migrated from github.com)

Hi @mateuspestana!
This particular issue is due to your version of opencv package being not compatible with DeepFaceLab code. As a temporary workaround you can edit the /Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/DeepFaceLab/core/imagelib/warp.py file and change the line

random_transform_mat = cv2.getRotationMatrix2D((w // 2, w // 2), rotation, scale)

to

random_transform_mat = cv2.getRotationMatrix2D((w // 2.0, w // 2.0), rotation, scale)
Hi @mateuspestana! This particular issue is due to your version of `opencv` package being not compatible with DeepFaceLab code. As a temporary workaround you can edit the `/Users/mateuspestana/Downloads/DeepFaceLab_MacOS/.dfl/DeepFaceLab/core/imagelib/warp.py` file and change the line ```python random_transform_mat = cv2.getRotationMatrix2D((w // 2, w // 2), rotation, scale) ``` to ```python random_transform_mat = cv2.getRotationMatrix2D((w // 2.0, w // 2.0), rotation, scale) ```
chychkan commented 2022-02-23 04:43:46 +01:00 (Migrated from github.com)

@mateuspestana did you get chance to try the ^^ workaround?

@mateuspestana did you get chance to try the ^^ workaround?
mateuspestana commented 2022-02-23 13:29:07 +01:00 (Migrated from github.com)

Just tried it and started training. By now, it's working flawlessly. Thanks!

Just tried it and started training. By now, it's working flawlessly. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CalvinBackup/DeepFaceLab_MacOS#72