Extract crashes with "Object arrays cannot be loaded when allow_pickle=False"

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.

Locked
User avatar
howhow54321
Posts: 2
Joined: Wed Jul 24, 2019 3:59 pm

Extract crashes with "Object arrays cannot be loaded when allow_pickle=False"

Post by howhow54321 »

I have an issue where when I begin faceswap's extract command, the program crashes in my Miniconda environment.
I'm using Ubuntu Budgie 19.04 and my graphics card is a Nvidia GTX 970. Any help would be appreciated please.

The crash report:

Code: Select all

07/24/2019 16:45:29 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager adding: (name: 'extract_save', maxsize: 0)
07/24/2019 16:45:29 MainProcess     MainThread      queue_manager   add_queue                 DEBUG    QueueManager added: (name: 'extract_save')
07/24/2019 16:45:29 MainProcess     MainThread      queue_manager   get_queue                 DEBUG    QueueManager got: 'extract_save'
07/24/2019 16:45:29 MainProcess     MainThread      extract         __init__                  DEBUG    Initialized Extract
07/24/2019 16:45:29 MainProcess     MainThread      extract         process                   INFO     Starting, this may take a while...
07/24/2019 16:45:29 MainProcess     MainThread      extract         threaded_io               DEBUG    Threading task: (Task: 'load')
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initializing MultiThread: (target: 'load_images', thread_count: 1)
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initialized MultiThread: 'load_images'
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread(s): 'load_images'
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread 1 of 1: 'load_images_0'
07/24/2019 16:45:29 MainProcess     load_images_0   extract         load_images               DEBUG    Load Images: Start
07/24/2019 16:45:29 MainProcess     load_images_0   fsmedia         load_video_frames         DEBUG    Input is video. Capturing frames
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Started all threads 'load_images': 1
07/24/2019 16:45:29 MainProcess     MainThread      extract         threaded_io               DEBUG    Threading task: (Task: 'save')
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initializing MultiThread: (target: 'save_faces', thread_count: 1)
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initialized MultiThread: 'save_faces'
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread(s): 'save_faces'
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Starting thread 1 of 1: 'save_faces_0'
07/24/2019 16:45:29 MainProcess     save_faces_0    extract         save_faces                DEBUG    Save Faces: Start
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Started all threads 'save_faces': 1
07/24/2019 16:45:29 MainProcess     MainThread      extract         process_item_count        DEBUG    Items already processed: 0
07/24/2019 16:45:29 MainProcess     MainThread      extract         process_item_count        DEBUG    Items to be Processed: 7332
07/24/2019 16:45:29 MainProcess     MainThread      pipeline        launch                    DEBUG    Launching detector
07/24/2019 16:45:29 MainProcess     MainThread      pipeline        launch_detector           DEBUG    Launching Detector
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initializing SpawnProcess: (target: 'Detector.run', args: (), kwargs: {})
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  __init__                  DEBUG    Initialized SpawnProcess: 'Detector.run'
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Spawning Process: (name: 'Detector.run', args: (), kwargs: {'event': <multiprocessing.synchronize.Event object at 0x7f4c5c523198>, 'error': <multiprocessing.synchronize.Event object at 0x7f4c5b526748>, 'log_init': <function set_root_logger at 0x7f4c827fb7b8>, 'log_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x7f4c82750ba8>, 'log_level': 10, 'in_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x7f4c6c2fd0b8>, 'out_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x7f4c5be24978>}, daemon: True)
07/24/2019 16:45:29 MainProcess     MainThread      multithreading  start                     DEBUG    Spawned Process: (name: 'Detector.run', PID: 8321)
07/24/2019 16:45:30 Detector.run    MainThread      _base           run                       DEBUG    Executing detector run function
07/24/2019 16:45:30 Detector.run    MainThread      _base           initialize                DEBUG    initialize Detect (PID: 8321, args: (), kwargs: {'event': <multiprocessing.synchronize.Event object at 0x7f4321eff208>, 'error': <multiprocessing.synchronize.Event object at 0x7f430f003d30>, 'log_init': <function set_root_logger at 0x7f4321e20a60>, 'log_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x7f43003d6828>, 'log_level': 10, 'in_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x7f43003d6940>, 'out_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x7f43003d69b0>})
07/24/2019 16:45:30 Detector.run    MainThread      mtcnn           initialize                INFO     Initializing MTCNN Detector...
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       __init__                  DEBUG    Initializing GPUStats
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       initialize                DEBUG    OS is not macOS. Using pynvml
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_device_count          DEBUG    GPU Device count: 1
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_active_devices        DEBUG    Active GPU Devices: [0]
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_handles               DEBUG    GPU Handles found: 1
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_driver                DEBUG    GPU Driver: 418.56
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_devices               DEBUG    GPU Devices: ['GeForce GTX 970']
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_vram                  DEBUG    GPU VRAM: [4041.6875]
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       __init__                  DEBUG    Initialized GPUStats
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       initialize                DEBUG    OS is not macOS. Using pynvml
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_device_count          DEBUG    GPU Device count: 1
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_active_devices        DEBUG    Active GPU Devices: [0]
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_handles               DEBUG    GPU Handles found: 1
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_free                  DEBUG    GPU VRAM free: [3716.25]
07/24/2019 16:45:30 Detector.run    MainThread      gpu_stats       get_card_most_free        DEBUG    Active GPU Card with most free VRAM: {'card_id': 0, 'device': 'GeForce GTX 970', 'free': 3716.25, 'total': 4041.6875}
07/24/2019 16:45:30 Detector.run    MainThread      _base           get_vram_free             VERBOSE  Using device GeForce GTX 970 with 3716MB free of 4041MB
07/24/2019 16:45:30 Detector.run    MainThread      deprecation     new_func                  WARNING  From /home/chris/miniconda3/envs/deepfake/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\nInstructions for updating:\nColocations handled automatically by placer.
07/24/2019 16:45:31 Detector.run    MainThread      deprecation     new_func                  WARNING  From /home/chris/faceswap/plugins/extract/detect/mtcnn.py:423: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\nInstructions for updating:\nDeprecated in favor of operator or tf.math.divide.
07/24/2019 16:45:31 Detector.run    MainThread      _base           detect_faces              ERROR    Object arrays cannot be loaded when allow_pickle=False
Traceback (most recent call last):
  File "/home/chris/faceswap/lib/cli.py", line 122, in execute_script
    process.process()
  File "/home/chris/faceswap/scripts/extract.py", line 61, in process
    self.run_extraction()
  File "/home/chris/faceswap/scripts/extract.py", line 181, in run_extraction
    self.extractor.launch()
  File "/home/chris/faceswap/plugins/extract/pipeline.py", line 175, in launch
    self.launch_detector()
  File "/home/chris/faceswap/plugins/extract/pipeline.py", line 238, in launch_detector
    raise ValueError("Error initializing Detector")
ValueError: Error initializing Detector

============ System Information ============
encoding:            UTF-8
git_branch:          master
git_commits:         5c17417 Training: Add Multi-Output Support. 652cd0b Update RealFace Description (#805). 65d2b19 Update Copy Alignments to use last frame with face (#799). 7ceeaba Switch to keras version for sort face (#791). 366d329 Merge branch 'master' into staging
gpu_cuda:            No global version found
gpu_cudnn:           No global version found
gpu_devices:         GPU_0: GeForce GTX 970
gpu_devices_active:  GPU_0
gpu_driver:          418.56
gpu_vram:            GPU_0: 4041MB
os_machine:          x86_64
os_platform:         Linux-5.0.0-20-generic-x86_64-with-debian-buster-sid
os_release:          5.0.0-20-generic
py_command:          faceswap.py extract -i /home/chris/deepfakes/source/How To Do Anything FAST!!! (Skit)-yVzR7XY9T-M.mp4 -o /home/chris/deepfakes/faces/tommy
py_conda_version:    N/A
py_implementation:   CPython
py_version:          3.7.3
py_virtual_env:      False
sys_cores:           6
sys_processor:       x86_64
sys_ram:             Total: 7875MB, Available: 2858MB, Used: 4235MB, Free: 393MB

=============== Pip Packages ===============
absl-py==0.7.1
astor==0.7.1
certifi==2019.6.16
cycler==0.10.0
decorator==4.4.0
fastcluster==1.1.25
ffmpy==0.2.2
gast==0.2.2
google-pasta==0.1.7
grpcio==1.16.1
h5py==2.9.0
imageio==2.5.0
imageio-ffmpeg==0.3.0
joblib==0.13.2
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
Markdown==3.1.1
matplotlib==2.2.2
mkl-fft==1.0.12
mkl-random==1.0.2
mkl-service==2.0.2
mock==3.0.5
networkx==2.3
numpy==1.16.4
nvidia-ml-py3==7.352.1
opencv-python==4.1.0.25
pathlib==1.0.1
Pillow==6.1.0
protobuf==3.8.0
psutil==5.6.3
pyparsing==2.4.0
python-dateutil==2.8.0
pytz==2019.1
PyWavelets==1.0.3
PyYAML==5.1.1
scikit-image==0.15.0
scikit-learn==0.21.2
scipy==1.3.0
six==1.12.0
tensorboard==1.12.2
tensorflow==1.13.0rc2
tensorflow-estimator==1.13.0
termcolor==1.1.0
toposort==1.5
tqdm==4.32.2
Werkzeug==0.15.4
wrapt==1.11.2
by bryanlyon » Wed Jul 24, 2019 4:27 pm

numpy==1.16.4

Here is your problem right here. Unfortunately numpy introduces an incompatibility with keras after 1.16.2. This is why we locked the version in the requirements.txt. Please downgrade your numpy to 1.16.2 and make sure that all packages match the versions we recommend in the requirements.txt file.

Go to full post
Last edited by torzdf on Wed Jul 24, 2019 4:41 pm, edited 1 time in total.
User avatar
bryanlyon
Site Admin
Posts: 793
Joined: Fri Jul 12, 2019 12:49 am
Answers: 44
Location: San Francisco
Has thanked: 4 times
Been thanked: 218 times
Contact:

Re: program crashes when trying to extract a video file in Ubuntu 19.04

Post by bryanlyon »

numpy==1.16.4

Here is your problem right here. Unfortunately numpy introduces an incompatibility with keras after 1.16.2. This is why we locked the version in the requirements.txt. Please downgrade your numpy to 1.16.2 and make sure that all packages match the versions we recommend in the requirements.txt file.

User avatar
howhow54321
Posts: 2
Joined: Wed Jul 24, 2019 3:59 pm

Re: Extract crashes with "Object arrays cannot be loaded when allow_pickle=False"

Post by howhow54321 »

Thanks, the extraction is working now. I did an automatic install from the requirements.txt file and it must have skipped the correct version of numpy. I also had the same problem with the Tensorflow version number but it is resolved.

Locked