M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

The Extraction process failing on you, and you aren't getting an error back with clear instructions? Tell us about it here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Extraction process. If you want to get tips, or better understand the Extract process, then you should look in the Extract Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

Yeah thats strange it didn't work before as I followed the installation process correctly. Must be an M1 Mac problem, and yes at least it's solved now. Only one more problem to solve... I can't save alignments when using the manual tool. I get the following error message - something to do with "ValueError"

Code: Select all

2023-04-29 01:34:56.397 python[1538:22971] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_bundleIdentifierWithReply:) block performed very slowly (7.64 secs).
Exception in Tkinter callback
Traceback (most recent call last):
File "/Users/User1/miniforge3/envs/faceswap/lib/python3.9/tkinter/__init__.py", line 1892, in __call__
return self.func(*args)
File "/Users/User1/faceswap/tools/manual/detected_faces.py", line 144, in save
self._children["io"].save()
File "/Users/User1/faceswap/tools/manual/detected_faces.py", line 286, in save
for idx, faces in zip(frames, np.array(self._frame_faces)[np.array(frames)]):
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6771,) + inhomogeneous part.
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Training Crash - TypeError: 'NoneType' object is not subscriptable

Post by torzdf »

That looks like an image hasn't rendered properly. Try saving often to protect against that happening.

Haven't really got much more to go on, unfortunately.

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Training Crash - TypeError: 'NoneType' object is not subscriptable

Post by DrDreGFunk »

Yeah no idea what’s going on, I’ve tried extracting the faces again but the problem still persists. Hopefully one day there’ll be a solution

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Training Crash - TypeError: 'NoneType' object is not subscriptable

Post by torzdf »

If you can provide the source + alignments file and steps to reproduce, I can look into this.

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Training Crash - TypeError: 'NoneType' object is not subscriptable

Post by DrDreGFunk »

Yeah sure and thank you so much! I've uploaded them to my google drive for you down the bottom - It's only an 11 second video that I wanted to manually go through and make sure all the faces were extracted properly. Me and my mate wanted to swap his face to it as a joke lol. The manual tool opens and works correctly, but whenever I try to save the alignments file after editing it that value error pops up. The first few shots at the start of the video are obstructed and doesn't pick up any faces, so I used the 'copy next alignment' feature to get them. I could simply crop out that part of the video to solve it, but if I ever work on a longer project in the future the manual tool would definitely be needed. I hope this error can be fixed so if you find any possible solutions please let me know!

https://drive.google.com/drive/folders/ ... sp=sharing

Last edited by DrDreGFunk on Mon May 08, 2023 4:14 pm, edited 1 time in total.
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Training Crash - TypeError: 'NoneType' object is not subscriptable

Post by torzdf »

Ok, so I have tested this and cannot recreate. Please can you give me the exact steps to recreate your error.

FWIW, I launch with:

Code: Select all

python tools.py manual -fr "/home/matt/Downloads/Mike O'hearn meme template.mp4"

Then:

  • Go to frame 2 (last frame at beginning without alignment) and copy the next alignment
  • Save
  • Go back one frame, copy next alignment, adjust extract box (green box) slightly
  • Save
  • Go back one frame (first frame), copy next alignment
  • Save.

All works fine:

Code: Select all

05/09/2023 19:27:20 INFO     Backing up original alignments to '/home/matt/Downloads/Mike O'hearn meme template_alignments_20230509_192720.fsa'
05/09/2023 19:27:20 INFO     Writing alignments to: '/home/matt/Downloads/Mike O'hearn meme template_alignments.fsa'
05/09/2023 19:27:54 INFO     Backing up original alignments to '/home/matt/Downloads/Mike O'hearn meme template_alignments_20230509_192754.fsa'
05/09/2023 19:27:54 INFO     Writing alignments to: '/home/matt/Downloads/Mike O'hearn meme template_alignments.fsa'
05/09/2023 19:28:07 INFO     Backing up original alignments to '/home/matt/Downloads/Mike O'hearn meme template_alignments_20230509_192807.fsa'
05/09/2023 19:28:07 INFO     Writing alignments to: '/home/matt/Downloads/Mike O'hearn meme template_alignments.fsa'

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

Strange, here's my exact steps:

  • Open Terminal

  • Put in

Code: Select all

conda activate /Users/User1/miniforge3/envs/faceswap
  • Next

Code: Select all

cd faceswap
  • Then

Code: Select all

python faceswap.py gui
  • Once the gui opens up, I head over to the manual tool section and input the path locations of the alignments file and video.

  • Run the manual script

Once the manual tool window pops up:

  • Go to frame 2 (last frame at beginning without alignment) and copy the next alignment

  • Save

Straight away as I save anything that annoying error pops up. I've tried running the manual tool directly from the terminal, but again chucks out this:

Attachments
FS Manual Tool Crash Report.log
(3.29 KiB) Downloaded 397 times
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by torzdf »

Ok, so 3 possible reasons

1) A race condition of some kind. I hope not, as debugging this will be next to impossible, but it is also the most likely
2) An issue with a specific version of an installed library. Please provide the output from the GUI: Help > Output System Information so I can check this
3) An issue with the Apple Silicon Tensorflow plugin. This seems unlikely as I would not expect this kind of behaviour, but it is possible.

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

Gotcha, yeah hopefully it's not that 1st possibility you suggested. Here's my output system information, I got my fingers crossed:

Code: Select all

============ System Information ============
backend:             apple_silicon
encoding:            UTF-8
git_branch:          master
git_commits:         e2ad3e2 add ru locale (#1311). 216ef38 alignments tool - batch jobs to run in process
gpu_cuda:            No global version found. Check Conda packages for Conda Cuda
gpu_cudnn:           No global version found. Check Conda packages for Conda cuDNN
gpu_devices:         GPU_0: /physical_device:GPU:0
gpu_devices_active:  GPU_0
gpu_driver:          Not Applicable
gpu_vram:            GPU_0: 16384MB (9498MB free)
os_machine:          arm64
os_platform:         macOS-13.3.1-arm64-arm-64bit
os_release:          22.4.0
py_command:          faceswap.py gui
py_conda_version:    conda 23.1.0
py_implementation:   CPython
py_version:          3.9.16
py_virtual_env:      True
sys_cores:           8
sys_processor:       arm
sys_ram:             Total: 16384MB, Available: 9475MB, Used: 6144MB, Free: 4591MB

=============== Pip Packages ===============
absl-py==1.4.0
appdirs==1.4.4
astor==0.8.1
astunparse==1.6.3
brotlipy==0.7.0
cachetools==5.3.0
certifi @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_5d968ni_yn/croot/certifi_1671487774636/work/certifi
cffi @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_ab19r4bji3/croot/cffi_1670423206034/work
charset-normalizer==3.1.0
cloudpickle==2.2.1
contourpy==1.0.7
cryptography @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_a9zjqvif1f/croot/cryptography_1677533099634/work
cycler @ file:///tmp/build/80754af9/cycler_1637851556182/work
decorator @ file:///opt/conda/conda-bld/decorator_1643638310831/work
dm-tree==0.1.8
fastcluster==1.2.6
ffmpeg==1.4
ffmpy==0.3.0
flatbuffers==23.3.3
fonttools==4.39.3
gast @ file:///tmp/build/80754af9/gast_1637837472536/work
google-auth==2.17.3
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.54.0
h5py==3.8.0
idna @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_771olrhiqw/croot/idna_1666125579282/work
imageio==2.27.0
imageio-ffmpeg @ file:///home/conda/feedstock_root/build_artifacts/imageio-ffmpeg_1673483481485/work
importlib-metadata==6.5.0
importlib-resources==5.12.0
jax==0.4.8
joblib @ file:///home/conda/feedstock_root/build_artifacts/joblib_1663332044897/work
keras==2.10.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_93o8te804v/croot/kiwisolver_1672387163224/work
libclang==16.0.0
Markdown==3.4.3
MarkupSafe==2.1.2
matplotlib==3.7.1
ml-dtypes==0.1.0
munkres==1.1.4
numexpr @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_98sxk8lloi/croot/numexpr_1668713874222/work
numpy==1.24.3
nvidia-ml-py==11.525.112
oauthlib==3.2.2
opencv-python==4.7.0.72
opt-einsum==3.3.0
packaging @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_e946luvhc3/croot/packaging_1678965323926/work
pexpect @ file:///tmp/build/80754af9/pexpect_1605563209008/work
Pillow==9.4.0
pooch @ file:///tmp/build/80754af9/pooch_1623324770023/work
protobuf==4.22.3
psutil @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_1310b568-21f4-4cb0-b0e3-2f3d31e39728k9coaga5/croots/recipe/psutil_1656431280844/work
ptyprocess @ file:///tmp/build/80754af9/ptyprocess_1609355006118/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
pyOpenSSL @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_38h4axtq38/croot/pyopenssl_1677607699670/work
pyparsing @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_3b_3vxnd07/croots/recipe/pyparsing_1661452540919/work
PySocks @ file:///Users/ktietz/Code/oss/ci_pkgs/pysocks_1626781349491/work
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
requests @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_37wt8ycste/croot/requests_1682607533309/work
requests-oauthlib==1.3.1
rsa==4.9
scikit-learn==1.2.2
scipy==1.10.1
six @ file:///tmp/build/80754af9/six_1644875935023/work
tensorboard==2.10.1
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow @ https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl#sha256=f587dc03b5f0d1e50cca39b7159c9f21ffdec96273dbf5f7619d48c622cb21f2
tensorflow-estimator==2.10.0
tensorflow-macos==2.10.0
tensorflow-metal==0.6.0
tensorflow-probability==0.19.0
termcolor==2.2.0
threadpoolctl @ file:///home/conda/feedstock_root/build_artifacts/threadpoolctl_1643647933166/work
tk==0.1.0
tornado @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_a61b4xoie9/croots/recipe/tornado_1662061692951/work
tqdm @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_ac7zic_tin/croot/tqdm_1679561870178/work
typing_extensions @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_19t7k81exs/croot/typing_extensions_1681939523533/work
urllib3 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_c7xh0_scrc/croot/urllib3_1680254693282/work
Werkzeug==2.2.3
wrapt==1.14.1
zipp==3.15.0

============== Conda Packages ==============
# packages in environment at /Users/User1/miniforge3/envs/faceswap:
#
# Name                    Version                   Build  Channel
absl-py                   1.4.0                    pypi_0    pypi
appdirs                   1.4.4              pyhd3eb1b0_0  
astor 0.8.1 pypi_0 pypi astunparse 1.6.3 pypi_0 pypi blas 1.0 openblas
brotli 1.0.9 h1a28f6b_7
brotli-bin 1.0.9 h1a28f6b_7
brotlipy 0.7.0 py39h1a28f6b_1002
bzip2 1.0.8 h3422bc3_4 conda-forge c-ares 1.19.0 h80987f9_0
ca-certificates 2023.01.10 hca03da5_0
cachetools 5.3.0 pypi_0 pypi certifi 2022.12.7 py39hca03da5_0
cffi 1.15.1 py39h80987f9_3
charset-normalizer 3.1.0 pypi_0 pypi cloudpickle 2.2.1 pypi_0 pypi contourpy 1.0.7 pypi_0 pypi cryptography 39.0.1 py39h834c97f_0
cycler 0.11.0 pyhd3eb1b0_0
decorator 5.1.1 pyhd3eb1b0_0
dm-tree 0.1.8 pypi_0 pypi fastcluster 1.2.6 pypi_0 pypi ffmpeg 1.4 pypi_0 pypi ffmpy 0.3.0 pypi_0 pypi flatbuffers 23.3.3 pypi_0 pypi fonttools 4.39.3 pypi_0 pypi freetype 2.12.1 h1192e45_0
gast 0.4.0 pypi_0 pypi gettext 0.21.1 h0186832_0 conda-forge giflib 5.2.1 h80987f9_3
gmp 6.2.1 h9f76cd9_0 conda-forge gnutls 3.6.15 h887c41c_0
google-auth 2.17.3 pypi_0 pypi google-auth-oauthlib 0.4.6 pypi_0 pypi google-pasta 0.2.0 pypi_0 pypi grpcio 1.54.0 pypi_0 pypi h5py 3.8.0 pypi_0 pypi hdf5 1.12.1 h160e8cb_2
idna 3.4 py39hca03da5_0
imageio 2.27.0 pypi_0 pypi imageio-ffmpeg 0.4.8 pyhd8ed1ab_0 conda-forge importlib-metadata 6.5.0 pypi_0 pypi importlib-resources 5.12.0 pypi_0 pypi jax 0.4.8 pypi_0 pypi joblib 1.2.0 pyhd8ed1ab_0 conda-forge jpeg 9e h80987f9_1
keras 2.10.0 pypi_0 pypi keras-applications 1.0.8 pypi_0 pypi keras-preprocessing 1.1.2 pypi_0 pypi kiwisolver 1.4.4 py39h313beb8_0
krb5 1.19.4 h8380606_0
lame 3.100 h1a8c8d9_1003 conda-forge lcms2 2.12 hba8e193_0
lerc 3.0 hc377ac9_0
libblas 3.9.0 16_osxarm64_openblas conda-forge libbrotlicommon 1.0.9 h1a28f6b_7
libbrotlidec 1.0.9 h1a28f6b_7
libbrotlienc 1.0.9 h1a28f6b_7
libcblas 3.9.0 16_osxarm64_openblas conda-forge libclang 16.0.0 pypi_0 pypi libcurl 7.88.1 h0f1d93c_0
libcxx 14.0.6 h848a8c0_0
libdeflate 1.17 h80987f9_0
libedit 3.1.20221030 h80987f9_0
libev 4.33 h1a28f6b_1
libffi 3.4.2 h3422bc3_5 conda-forge libgfortran 5.0.0 11_3_0_hca03da5_28
libgfortran5 11.3.0 h009349e_28
libiconv 1.17 he4db4b2_0 conda-forge libidn2 2.3.4 h1a8c8d9_0 conda-forge liblapack 3.9.0 16_osxarm64_openblas conda-forge libnghttp2 1.46.0 h95c9599_0
libopenblas 0.3.21 h269037a_0
libopus 1.3.1 h27ca646_1 conda-forge libpng 1.6.39 h80987f9_0
libprotobuf 3.19.6 h514c7bf_0
libssh2 1.10.0 hf27765b_0
libtasn1 4.19.0 h1a8c8d9_0 conda-forge libtiff 4.5.0 h313beb8_2
libunistring 0.9.10 h3422bc3_0 conda-forge libvpx 1.10.0 hc377ac9_0
libwebp 1.2.4 ha3663a8_1
libwebp-base 1.2.4 h80987f9_1
llvm-openmp 14.0.6 hc6e5704_0
lz4-c 1.9.4 h313beb8_0
markdown 3.4.3 pypi_0 pypi markupsafe 2.1.2 pypi_0 pypi matplotlib 3.7.1 pypi_0 pypi matplotlib-base 3.5.3 py39hc377ac9_0
ml-dtypes 0.1.0 pypi_0 pypi munkres 1.1.4 py_0
ncurses 6.3 h07bb92c_1 conda-forge nettle 3.7.3 h84b5d62_1
numexpr 2.8.4 py39h79ee842_0
numpy 1.24.2 pypi_0 pypi numpy-base 1.22.3 py39h974a1f5_0
nvidia-ml-py 11.525.112 pypi_0 pypi oauthlib 3.2.2 pypi_0 pypi opencv-python 4.7.0.72 pypi_0 pypi openh264 1.8.0 h98b2900_0
openssl 1.1.1t h1a28f6b_0
opt-einsum 3.3.0 pypi_0 pypi packaging 23.0 py39hca03da5_0
pexpect 4.8.0 pyhd3eb1b0_3
pillow 9.4.0 py39h313beb8_0
pip 23.1.2 pypi_0 pypi pooch 1.4.0 pyhd3eb1b0_0
protobuf 4.22.3 pypi_0 pypi psutil 5.9.0 py39h1a28f6b_0
ptyprocess 0.7.0 pyhd3eb1b0_2
pyasn1 0.5.0 pypi_0 pypi pyasn1-modules 0.3.0 pypi_0 pypi pycparser 2.21 pyhd3eb1b0_0
pyopenssl 23.0.0 py39hca03da5_0
pyparsing 3.0.9 py39hca03da5_0
pysocks 1.7.1 py39hca03da5_0
python 3.9.16 hc0d8a6c_0
python-dateutil 2.8.2 pyhd3eb1b0_0
readline 8.2 h92ec313_1 conda-forge requests 2.28.2 pypi_0 pypi requests-oauthlib 1.3.1 pypi_0 pypi rsa 4.9 pypi_0 pypi scikit-learn 1.2.2 pypi_0 pypi scipy 1.10.1 pypi_0 pypi setuptools 67.6.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyhd3eb1b0_1
sqlite 3.40.1 h7a7dc30_0
tensorboard 2.10.1 pypi_0 pypi tensorboard-data-server 0.6.1 pypi_0 pypi tensorboard-plugin-wit 1.8.1 pypi_0 pypi tensorflow 1.12.0 pypi_0 pypi tensorflow-deps 2.9.0 0 apple tensorflow-estimator 2.10.0 pypi_0 pypi tensorflow-macos 2.10.0 pypi_0 pypi tensorflow-metal 0.6.0 pypi_0 pypi tensorflow-probability 0.19.0 pypi_0 pypi termcolor 2.2.0 pypi_0 pypi threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge tk 0.1.0 pypi_0 pypi tornado 6.2 py39h1a28f6b_0
tqdm 4.65.0 py39h86d0a89_0
typing-extensions 4.5.0 py39hca03da5_0
typing_extensions 4.5.0 py39hca03da5_0
tzdata 2023c h71feb2d_0 conda-forge urllib3 1.26.15 py39hca03da5_0
werkzeug 2.2.3 pypi_0 pypi wheel 0.40.0 pyhd8ed1ab_0 conda-forge wrapt 1.14.1 pypi_0 pypi x264 1!152.20180806 h1a28f6b_0
xz 5.2.10 h80987f9_1
zipp 3.15.0 pypi_0 pypi zlib 1.2.13 h5a0b063_0
zstd 1.5.5 hd90d995_0 ================= Configs ================== --------- convert.ini --------- [color.color_transfer] clip: True preserve_paper: True [color.match_hist] threshold: 99.0 [color.manual_balance] colorspace: HSV balance_1: 0.0 balance_2: 0.0 balance_3: 0.0 contrast: 0.0 brightness: 0.0 [writer.pillow] format: png draw_transparent: False separate_mask: False optimize: False gif_interlace: True jpg_quality: 75 png_compress_level: 3 tif_compression: tiff_deflate [writer.ffmpeg] container: mp4 codec: libx264 crf: 16 preset: medium tune: none profile: auto level: auto skip_mux: False [writer.gif] fps: 25 loop: 0 palettesize: 256 subrectangles: False [writer.opencv] format: png draw_transparent: False separate_mask: False jpg_quality: 75 png_compress_level: 3 [mask.mask_blend] type: normalized kernel_size: 3 passes: 4 threshold: 4 erosion: 0.0 erosion_top: 0.0 erosion_bottom: 0.0 erosion_left: 0.0 erosion_right: 0.0 [scaling.sharpen] method: None amount: 150 radius: 0.3 threshold: 5.0 --------- gui.ini --------- [global] fullscreen: False tab: extract options_panel_width: 30 console_panel_height: 20 icon_size: 14 font: default font_size: 9 autosave_last_session: prompt timeout: 120 auto_load_model_stats: True --------- .faceswap --------- backend: apple_silicon --------- extract.ini --------- [global] allow_growth: False aligner_min_scale: 0.07 aligner_max_scale: 2.0 aligner_distance: 22.5 aligner_roll: 45.0 aligner_features: True filter_refeed: True save_filtered: False realign_refeeds: True filter_realign: True [detect.mtcnn] minsize: 20 scalefactor: 0.709 batch-size: 8 cpu: True threshold_1: 0.6 threshold_2: 0.7 threshold_3: 0.7 [detect.cv2_dnn] confidence: 50 [detect.s3fd] confidence: 70 batch-size: 4 [align.fan] batch-size: 12 [mask.unet_dfl] batch-size: 8 [mask.custom] batch-size: 8 centering: face fill: False [mask.vgg_obstructed] batch-size: 2 [mask.vgg_clear] batch-size: 6 [mask.bisenet_fp] batch-size: 8 cpu: False weights: faceswap include_ears: False include_hair: False include_glasses: True [recognition.vgg_face2] batch-size: 16 cpu: False --------- train.ini --------- [global] centering: face coverage: 87.5 icnr_init: False conv_aware_init: False optimizer: adam learning_rate: 5e-05 epsilon_exponent: -7 autoclip: False reflect_padding: False allow_growth: False mixed_precision: False nan_protection: True convert_batchsize: 16 [global.loss] loss_function: ssim loss_function_2: mse loss_weight_2: 100 loss_function_3: none loss_weight_3: 0 loss_function_4: none loss_weight_4: 0 mask_loss_function: mse eye_multiplier: 3 mouth_multiplier: 2 penalized_mask_loss: True mask_type: extended mask_blur_kernel: 3 mask_threshold: 4 learn_mask: False [model.phaze_a] output_size: 128 shared_fc: none enable_gblock: True split_fc: True split_gblock: False split_decoders: False enc_architecture: fs_original enc_scaling: 7 enc_load_weights: True bottleneck_type: dense bottleneck_norm: none bottleneck_size: 1024 bottleneck_in_encoder: True fc_depth: 1 fc_min_filters: 1024 fc_max_filters: 1024 fc_dimensions: 4 fc_filter_slope: -0.5 fc_dropout: 0.0 fc_upsampler: upsample2d fc_upsamples: 1 fc_upsample_filters: 512 fc_gblock_depth: 3 fc_gblock_min_nodes: 512 fc_gblock_max_nodes: 512 fc_gblock_filter_slope: -0.5 fc_gblock_dropout: 0.0 dec_upscale_method: subpixel dec_upscales_in_fc: 0 dec_norm: none dec_min_filters: 64 dec_max_filters: 512 dec_slope_mode: full dec_filter_slope: -0.45 dec_res_blocks: 1 dec_output_kernel: 5 dec_gaussian: True dec_skip_last_residual: True freeze_layers: keras_encoder load_layers: encoder fs_original_depth: 4 fs_original_min_filters: 128 fs_original_max_filters: 1024 fs_original_use_alt: False mobilenet_width: 1.0 mobilenet_depth: 1 mobilenet_dropout: 0.001 mobilenet_minimalistic: False [model.realface] input_size: 64 output_size: 128 dense_nodes: 1536 complexity_encoder: 128 complexity_decoder: 512 [model.dfl_sae] input_size: 128 architecture: df autoencoder_dims: 0 encoder_dims: 42 decoder_dims: 21 multiscale_decoder: False [model.unbalanced] input_size: 128 lowmem: False nodes: 1024 complexity_encoder: 128 complexity_decoder_a: 384 complexity_decoder_b: 512 [model.dlight] features: best details: good output_size: 256 [model.villain] lowmem: False [model.dfaker] output_size: 128 [model.original] lowmem: False [model.dfl_h128] lowmem: False [trainer.original] preview_images: 14 mask_opacity: 30 mask_color: #ff0000 zoom_amount: 5 rotation_range: 10 shift_range: 5 flip_chance: 50 color_lightness: 30 color_ab: 8 color_clahe_chance: 50 color_clahe_max_size: 4
User avatar
MaxHunter
Posts: 193
Joined: Thu May 26, 2022 6:02 am
Has thanked: 176 times
Been thanked: 13 times

Re: Per Discord convo. Here's the anaconda prompts.

Post by MaxHunter »

Okay. I don't know if this is related to this: viewtopic.php?t=2725 but a new error has popped up. This one is related to extraction:

Code: Select all

06/27/2023 20:37:15 ERROR    Got Exception on main handler:
Traceback (most recent call last):
  File "C:\Users\e4978\faceswap\lib\cli\launcher.py", line 225, in execute_script
    process.process()
  File "C:\Users\e4978\faceswap\scripts\extract.py", line 178, in process
    extract.process()
  File "C:\Users\e4978\faceswap\scripts\extract.py", line 702, in process
    self._run_extraction()
  File "C:\Users\e4978\faceswap\scripts\extract.py", line 726, in _run_extraction
    for idx, extract_media in enumerate(tqdm(self._extractor.detected_faces(),
  File "C:\Users\e4978\MiniConda3\envs\faceswap\lib\site-packages\tqdm\std.py", line 1178, in __iter__
    for obj in iterable:
  File "C:\Users\e4978\faceswap\plugins\extract\pipeline.py", line 293, in detected_faces
    self._check_and_raise_error()
  File "C:\Users\e4978\faceswap\plugins\extract\pipeline.py", line 777, in _check_and_raise_error
    plugin.check_and_raise_error()
  File "C:\Users\e4978\faceswap\plugins\extract\_base.py", line 398, in check_and_raise_error
    thread.check_and_raise_error()
  File "C:\Users\e4978\faceswap\lib\multithreading.py", line 172, in check_and_raise_error
    raise error[1].with_traceback(error[2])
  File "C:\Users\e4978\faceswap\lib\multithreading.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\e4978\faceswap\plugins\extract\_base.py", line 602, in _thread_process
    batch = function(batch)
  File "C:\Users\e4978\faceswap\plugins\extract\align\_base\aligner.py", line 534, in _predict
    batch.prediction = np.array([self.predict(feed) for feed in batch.refeeds])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (8,) + inhomogeneous part.
06/27/2023 20:37:15 CRITICAL An unexpected crash has occurred. Crash report written to 'C:\Users\e4978\faceswap\crash_report.2023.06.27.203713573641.log'. You MUST provide this file if seeking assistance. Please verify you are running the latest version of faceswap before reporting
Last edited by torzdf on Wed Jun 28, 2023 9:49 am, edited 2 times in total.
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by torzdf »

Ok, going to revisit this today. I suspect it is a numpy version issue.

My word is final

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by torzdf »

Both of these bugs now fixed in the latest code.

I would expect to see more, similar, bugs as Numpy has made a change to how it handles mismatched array sizes. If you see any, please start a new thread

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

It would be nice to see if it worked after all this time, however I ran the FS update and got presented with this! Now I can't even load up the gui anymore. I did notice before I closed it down and potentially the reason why I can't open it now is it failed to install 'tensorflow deps 2.11.0'?

Code: Select all

conda activate /Users/User1/miniforge3/envs/faceswap
(faceswap) User1-MacBook-Pro ~ % 
cd faceswap
(faceswap) User1-MacBook-Pro faceswap % python faceswap.py gui
Setting Faceswap backend to APPLE_SILICON
Traceback (most recent call last):
  File "/Users/User1/faceswap/faceswap.py", line 12, in <module>
    from lib.cli import args as cli_args  # pylint:disable=wrong-import-position
  File "/Users/User1/faceswap/lib/cli/args.py", line 18, in <module>
    from .actions import (DirFullPaths, DirOrFileFullPaths, DirOrFilesFullPaths, FileFullPaths,
  File "/Users/User1/faceswap/lib/cli/actions.py", line 49, in <module>
    class FileFullPaths(_FullPaths):
  File "/Users/User1/faceswap/lib/cli/actions.py", line 72, in FileFullPaths
    def __init__(self, *args, filetypes: str | None = None, **kwargs) -> None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by torzdf »

You need to do a full reinstall (delete the Faceswap environment and follow the instructions for install on github: https://github.com/deepfakes/faceswap/b ... tall-guide).

This update upgrades the minimum version of Python. The version you are on is no longer supported.

Last edited by torzdf on Fri Jun 30, 2023 1:34 am, edited 1 time in total.

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

Got it working and it says it's up to date! :D Only thing that pops up now is this when I tried using the manual tool (it saves now finally btw!). I'm not sure whether to ignore this or not...

Code: Select all

2023-06-30 11:45:45.064 python[11461:117017] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_bundleIdentifierWithReply:) block performed very slowly (6.53 secs).
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by torzdf »

Ok, that is definitely an Apple specific message.

I suspect, if everything still seems to work fine, then you can just ignore it. Either way, there is unlikely to be anything I can do about that particular message as it occurs well upstream of Faceswap.

Some more info: https://stackoverflow.com/questions/409 ... l-detected

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

That makes sense, thank you so much for all your help though and I'm glad I can continue the project with my mate! I might try updating my mac then and see if that does anything

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

I just wanted to report that on the manual tool, this error message pops up when I change the filter from 'All Frames' to 'Has Faces'. Hopefully this will be the very last problem, but mentions something to do with Tkinter?

Code: Select all

Exception in Tkinter callback
Traceback (most recent call last):
File "/Users/User1/miniforge3/envs/FS/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
return self.func(*args)
File "/Users/User1/faceswap/tools/manual/manual.py", line 250, in _handle_key_press
bindings[key_press.lower()]()
File "/Users/User1/faceswap/tools/manual/frameviewer/control.py", line 115, in decrement_frame
face_count_change = not self._det_faces.filter.frame_meets_criteria
File "/Users/User1/faceswap/tools/manual/detected_faces.py", line 497, in frame_meets_criteria
assert isinstance(retval, bool)
AssertionError
Exception in Tkinter callback
Traceback (most recent call last):
File "/Users/User1/miniforge3/envs/FS/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
return self.func(*args)
File "/Users/User1/faceswap/tools/manual/manual.py", line 250, in _handle_key_press
bindings[key_press.lower()]()
File "/Users/User1/faceswap/tools/manual/frameviewer/control.py", line 115, in decrement_frame
face_count_change = not self._det_faces.filter.frame_meets_criteria
File "/Users/User1/faceswap/tools/manual/detected_faces.py", line 497, in frame_meets_criteria
assert isinstance(retval, bool)
AssertionError
Exception in Tkinter callback
Traceback (most recent call last):
File "/Users/User1/miniforge3/envs/FS/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
return self.func(*args)
File "/Users/User1/faceswap/tools/manual/manual.py", line 250, in _handle_key_press
bindings[key_press.lower()]()
File "/Users/User1/faceswap/tools/manual/frameviewer/control.py", line 101, in increment_frame
face_count_change = not self._det_faces.filter.frame_meets_criteria
File "/Users/User1/faceswap/tools/manual/detected_faces.py", line 497, in frame_meets_criteria
assert isinstance(retval, bool)
AssertionError
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by torzdf »

Ok, this one (again) I can't recreate.

If you can give me exact steps to recreate this issue, please do (assuming the same file + alignments file)

Last edited by torzdf on Thu Jul 06, 2023 3:43 pm, edited 1 time in total.

My word is final

User avatar
DrDreGFunk
Posts: 22
Joined: Wed Aug 26, 2020 5:36 pm
Has thanked: 5 times
Been thanked: 2 times

Re: M1 Macbook Pro Manual Tool - ValueError: setting an array element with a sequence

Post by DrDreGFunk »

Ah ok and yes same alignments file and video. All I'm doing is loading up the gui as normal with 'conda activate faceswap', 'cd faceswap' and then 'python faceswap.py gui'. Once the gui is loaded, I head over to the 'Tools' tab and then I select the manual tool sub heading. I input the alignments file and video in their designated paths and then run it. Once the manual tool opens up, I select the 'Has Faces' filter from the dropdown menu and then that error pops up

Locked