deepfakes / faceswap

Deepfakes Software For All
https://www.faceswap.dev
GNU General Public License v3.0
52.57k stars 13.24k forks source link

Exception: Unable to open file (bad object header version number) #727

Closed joaoreiis closed 5 years ago

joaoreiis commented 5 years ago
05/13/2019 14:29:37 MainProcess     MainThread      _base           replace_config            INFO     Using configuration saved in state file
05/13/2019 14:29:37 MainProcess     MainThread      _base           new_session_id            DEBUG    2
05/13/2019 14:29:37 MainProcess     MainThread      _base           create_new_session        DEBUG    Creating new session. id: 2
05/13/2019 14:29:37 MainProcess     MainThread      _base           __init__                  DEBUG    Initialized State:
05/13/2019 14:29:37 MainProcess     MainThread      _base           name                      DEBUG    model name: 'original'
05/13/2019 14:29:37 MainProcess     MainThread      _base           rename_legacy             DEBUG    Renaming legacy files
05/13/2019 14:29:37 MainProcess     MainThread      _base           name                      DEBUG    model name: 'original'
05/13/2019 14:29:37 MainProcess     MainThread      _base           rename_legacy             DEBUG    No legacy files to rename
05/13/2019 14:29:37 MainProcess     MainThread      _base           load_state_info           DEBUG    Loading Input Shape from State file
05/13/2019 14:29:37 MainProcess     MainThread      _base           load_state_info           DEBUG    Setting input shape from state file: (64, 64, 3)
05/13/2019 14:29:37 MainProcess     MainThread      original        add_networks              DEBUG    Adding networks
05/13/2019 14:29:37 MainProcess     MainThread      nn_blocks       upscale                   DEBUG    inp: Tensor("input_1:0", shape=(?, 8, 8, 512), dtype=float32), filters: 256, kernel_size: 3, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:37 MainProcess     MainThread      nn_blocks       upscale                   DEBUG    inp: Tensor("pixel_shuffler_1/Reshape_1:0", shape=(?, 16, 16, 256), dtype=float32), filters: 128, kernel_size: 3, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:37 MainProcess     MainThread      nn_blocks       upscale                   DEBUG    inp: Tensor("pixel_shuffler_2/Reshape_1:0", shape=(?, 32, 32, 128), dtype=float32), filters: 64, kernel_size: 3, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:37 MainProcess     MainThread      _base           add_network               DEBUG    network_type: 'decoder', side: 'a', network: '<keras.engine.training.Model object at 0x000002AED2AC46D8>'
05/13/2019 14:29:37 MainProcess     MainThread      _base           name                      DEBUG    model name: 'original'
05/13/2019 14:29:37 MainProcess     MainThread      _base           add_network               DEBUG    name: 'decoder_a', filename: 'original_decoder_A.h5'
05/13/2019 14:29:37 MainProcess     MainThread      _base           __init__                  DEBUG    Initializing NNMeta: (filename: 'H:\Users\joao_\faceswap\models\original_decoder_A.h5', network_type: 'decoder', side: 'a', network: <keras.engine.training.Model object at 0x000002AED2AC46D8>
05/13/2019 14:29:38 MainProcess     MainThread      _base           __init__                  DEBUG    Initialized NNMeta
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       upscale                   DEBUG    inp: Tensor("input_2:0", shape=(?, 8, 8, 512), dtype=float32), filters: 256, kernel_size: 3, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       upscale                   DEBUG    inp: Tensor("pixel_shuffler_4/Reshape_1:0", shape=(?, 16, 16, 256), dtype=float32), filters: 128, kernel_size: 3, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       upscale                   DEBUG    inp: Tensor("pixel_shuffler_5/Reshape_1:0", shape=(?, 32, 32, 128), dtype=float32), filters: 64, kernel_size: 3, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      _base           add_network               DEBUG    network_type: 'decoder', side: 'b', network: '<keras.engine.training.Model object at 0x000002AF7C94BD30>'
05/13/2019 14:29:38 MainProcess     MainThread      _base           name                      DEBUG    model name: 'original'
05/13/2019 14:29:38 MainProcess     MainThread      _base           add_network               DEBUG    name: 'decoder_b', filename: 'original_decoder_B.h5'
05/13/2019 14:29:38 MainProcess     MainThread      _base           __init__                  DEBUG    Initializing NNMeta: (filename: 'H:\Users\joao_\faceswap\models\original_decoder_B.h5', network_type: 'decoder', side: 'b', network: <keras.engine.training.Model object at 0x000002AF7C94BD30>
05/13/2019 14:29:38 MainProcess     MainThread      _base           __init__                  DEBUG    Initialized NNMeta
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       conv                      DEBUG    inp: Tensor("input_3:0", shape=(?, 64, 64, 3), dtype=float32), filters: 128, kernel_size: 5, strides: 2, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       conv                      DEBUG    inp: Tensor("leaky_re_lu_7/LeakyRelu:0", shape=(?, 32, 32, 128), dtype=float32), filters: 256, kernel_size: 5, strides: 2, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       conv                      DEBUG    inp: Tensor("leaky_re_lu_8/LeakyRelu:0", shape=(?, 16, 16, 256), dtype=float32), filters: 512, kernel_size: 5, strides: 2, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       conv                      DEBUG    inp: Tensor("leaky_re_lu_9/LeakyRelu:0", shape=(?, 8, 8, 512), dtype=float32), filters: 1024, kernel_size: 5, strides: 2, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      nn_blocks       upscale                   DEBUG    inp: Tensor("reshape_1/Reshape:0", shape=(?, 4, 4, 1024), dtype=float32), filters: 512, kernel_size: 3, use_instance_norm: False, kwargs: {})
05/13/2019 14:29:38 MainProcess     MainThread      _base           add_network               DEBUG    network_type: 'encoder', side: 'None', network: '<keras.engine.training.Model object at 0x000002AF7DC04C50>'
05/13/2019 14:29:38 MainProcess     MainThread      _base           name                      DEBUG    model name: 'original'
05/13/2019 14:29:38 MainProcess     MainThread      _base           add_network               DEBUG    name: 'encoder', filename: 'original_encoder.h5'
05/13/2019 14:29:38 MainProcess     MainThread      _base           __init__                  DEBUG    Initializing NNMeta: (filename: 'H:\Users\joao_\faceswap\models\original_encoder.h5', network_type: 'encoder', side: 'None', network: <keras.engine.training.Model object at 0x000002AF7DC04C50>
05/13/2019 14:29:38 MainProcess     MainThread      _base           __init__                  DEBUG    Initialized NNMeta
05/13/2019 14:29:38 MainProcess     MainThread      original        add_networks              DEBUG    Added networks
05/13/2019 14:29:38 MainProcess     MainThread      _base           load_models               DEBUG    Load model: (swapped: False)
05/13/2019 14:29:38 MainProcess     MainThread      _base           models_exist              DEBUG    Pre-existing models exist: True
05/13/2019 14:29:38 MainProcess     MainThread      _base           models_exist              DEBUG    Pre-existing models exist: True
05/13/2019 14:29:38 MainProcess     MainThread      _base           map_models                DEBUG    Map models: (swapped: False)
05/13/2019 14:29:38 MainProcess     MainThread      _base           map_models                DEBUG    Mapped models: (models_map: {'a': {'decoder': 'H:\\Users\\joao_\\faceswap\\models\\original_decoder_A.h5'}, 'b': {'decoder': 'H:\\Users\\joao_\\faceswap\\models\\original_decoder_B.h5'}})
05/13/2019 14:29:38 MainProcess     MainThread      _base           load                      DEBUG    Loading model: 'H:\Users\joao_\faceswap\models\original_decoder_A.h5'
05/13/2019 14:29:39 MainProcess     MainThread      _base           load                      DEBUG    Loading model: 'H:\Users\joao_\faceswap\models\original_decoder_B.h5'
05/13/2019 14:29:39 MainProcess     MainThread      _base           load                      DEBUG    Loading model: 'H:\Users\joao_\faceswap\models\original_encoder.h5'
05/13/2019 14:29:39 MainProcess     MainThread      _base           load                      WARNING  Failed loading existing training data. Generating new models
05/13/2019 14:29:39 MainProcess     MainThread      _base           load                      DEBUG    Exception: Unable to open file (bad object header version number)
05/13/2019 14:29:39 MainProcess     MainThread      original        build_autoencoders        DEBUG    Initializing model
05/13/2019 14:29:39 MainProcess     MainThread      original        build_autoencoders        DEBUG    Adding Autoencoder. Side: a
Traceback (most recent call last):
  File "H:\Users\joao_\faceswap\lib\cli.py", line 109, in execute_script
    process = script(arguments)
  File "H:\Users\joao_\faceswap\scripts\convert.py", line 45, in __init__
    self.predictor = Predict(self.disk_io.load_queue, self.queue_size, arguments)
  File "H:\Users\joao_\faceswap\scripts\convert.py", line 406, in __init__
    self.model = self.load_model()
  File "H:\Users\joao_\faceswap\scripts\convert.py", line 449, in load_model
    model = PluginLoader.get_model(trainer)(model_dir, self.args.gpus, predict=True)
  File "H:\Users\joao_\faceswap\plugins\train\model\original.py", line 24, in __init__
    super().__init__(*args, **kwargs)
  File "H:\Users\joao_\faceswap\plugins\train\model\_base.py", line 90, in __init__
    self.build()
  File "H:\Users\joao_\faceswap\plugins\train\model\_base.py", line 166, in build
    self.build_autoencoders()
  File "H:\Users\joao_\faceswap\plugins\train\model\original.py", line 46, in build_autoencoders
    output = decoder(self.networks["encoder"].network(inputs[0]))
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\keras\engine\base_layer.py", line 457, in __call__
    output = self.call(inputs, **kwargs)
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\keras\engine\network.py", line 564, in call
    output_tensors, _, _ = self.run_internal_graph(inputs, masks)
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\keras\engine\network.py", line 721, in run_internal_graph
    layer.call(computed_tensor, **kwargs))
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\keras\layers\convolutional.py", line 171, in call
    dilation_rate=self.dilation_rate)
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\keras\backend\tensorflow_backend.py", line 3650, in conv2d
    data_format=tf_data_format)
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 767, in convolution
    with ops.name_scope(name, "convolution", [input, filter]) as name:
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\framework\ops.py", line 6023, in __enter__
    g = _get_graph_from_inputs(self._values)
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\framework\ops.py", line 5664, in _get_graph_from_inputs
    _assert_same_graph(original_graph_element, graph_element)
  File "C:\Users\joao_\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\framework\ops.py", line 5600, in _assert_same_graph
    original_item))
ValueError: Tensor("conv2d_9/kernel:0", shape=(5, 5, 3, 128), dtype=float32_ref) must be from the same graph as Tensor("face:0", shape=(?, 64, 64, 3), dtype=float32).

============ System Information ============
encoding:            cp1252
git_branch:          master
git_commits:         057f715 Pin MiniConda in installer to v4.15.12
gpu_cuda:            9.0
gpu_cudnn:           7.5.0
gpu_devices:         GPU_0: GeForce GTX 1050 Ti
gpu_devices_active:  GPU_0
gpu_driver:          385.54
gpu_vram:            GPU_0: 4096MB
os_machine:          AMD64
os_platform:         Windows-10-10.0.17763-SP0
os_release:          10
py_command:          H:\Users\joao_\faceswap\faceswap.py convert -i H:/Users/joao_/faceswap/scarllet.mp4 -o H:/Users/joao_/faceswap/out -l 0.6 -m H:/Users/joao_/faceswap/models -c avg-color -sc none -M predicted -w opencv -osc 100 -g 1 -t original -L INFO -gui
py_conda_version:    conda 4.5.12
py_implementation:   CPython
py_version:          3.6.8
py_virtual_env:      True
sys_cores:           4
sys_processor:       Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
sys_ram:             Total: 8174MB, Available: 2208MB, Used: 5965MB, Free: 2208MB

=============== Pip Packages ===============
absl-py==0.7.1
astor==0.7.1
certifi==2019.3.9
Click==7.0
cloudpickle==1.0.0
cmake==3.13.3
cycler==0.10.0
cytoolz==0.9.0.1
dask==1.2.2
decorator==4.4.0
dlib==19.16.99
face-recognition==1.2.3
face-recognition-models==0.3.0
ffmpy==0.2.2
gast==0.2.2
grpcio==1.16.1
h5py==2.9.0
imageio==2.5.0
imageio-ffmpeg==0.3.0
isort==4.3.17
Keras==2.2.4
Keras-Applications==1.0.7
Keras-Preprocessing==1.0.9
kiwisolver==1.1.0
Markdown==3.1
matplotlib==2.2.2
mccabe==0.6.1
mkl-fft==1.0.12
mkl-random==1.0.2
mock==2.0.0
networkx==2.3
numpy==1.16.2
nvidia-ml-py3==7.352.0
olefile==0.46
opencv-python==4.1.0.25
pathlib==1.0.1
pbr==5.1.3
Pillow==6.0.0
protobuf==3.7.1
psutil==5.6.2
pyparsing==2.4.0
pyreadline==2.1
python-dateutil==2.8.0
pytz==2019.1
PyWavelets==1.0.3
PyYAML==5.1
scikit-image==0.15.0
scikit-learn==0.20.3
scipy==1.2.1
six==1.12.0
tensorboard==1.12.2
tensorflow==1.12.0
tensorflow-estimator==1.13.0
termcolor==1.1.0
toolz==0.9.0
toposort==1.5
tornado==6.0.2
tqdm==4.31.1
Werkzeug==0.15.2
wincertstore==0.2

============== Conda Packages ==============
# packages in environment at C:\Users\joao_\MiniConda3\envs\faceswap:
#
# Name                    Version                   Build  Channel
_tflow_select             2.1.0                       gpu  
absl-py                   0.7.1                    py36_0  
astor                     0.7.1                    py36_0  
blas                      1.0                         mkl  
ca-certificates           2019.1.23                     0  
certifi                   2019.3.9                 py36_0  
Click                     7.0                       <pip>
cloudpickle               1.0.0                      py_0  
cmake                     3.13.3                    <pip>
cudatoolkit               9.0                           1  
cudnn                     7.3.1                 cuda9.0_0  
cycler                    0.10.0           py36h009560c_0  
cytoolz                   0.9.0.1          py36hfa6e2cd_1  
dask-core                 1.2.2                      py_0  
decorator                 4.4.0                    py36_1  
dlib                      19.16.99                  <pip>
face-recognition          1.2.3                     <pip>
face-recognition-models   0.3.0                     <pip>
ffmpeg                    4.1.3                h6538335_0    conda-forge
ffmpy                     0.2.2                     <pip>
freetype                  2.9.1                ha9979f8_1  
gast                      0.2.2                    py36_0  
grpcio                    1.16.1           py36h351948d_1  
h5py                      2.9.0            py36h5e291fa_0  
hdf5                      1.10.4               h7ebc959_0  
icc_rt                    2019.0.0             h0cc432a_1  
icu                       58.2                 ha66f8fd_1  
imageio                   2.5.0                    py36_0  
imageio-ffmpeg            0.3.0                     <pip>
intel-openmp              2019.3                      203  
jpeg                      9b                   hb83a4c4_2  
keras                     2.2.4                         0  
keras-applications        1.0.7                      py_0  
keras-base                2.2.4                    py36_0  
keras-preprocessing       1.0.9                      py_0  
kiwisolver                1.1.0            py36ha925a31_0  
libmklml                  2019.0.3                      0  
libpng                    1.6.37               h2a8f88b_0  
libprotobuf               3.7.1                h7bd577a_0  
libtiff                   4.0.10               hb898794_2  
markdown                  3.1                      py36_0  
matplotlib                2.2.2            py36had4c4a9_2  
mkl                       2019.3                      203  
mkl_fft                   1.0.12           py36h14836fe_0  
mkl_random                1.0.2            py36h343c172_0  
mock                      2.0.0            py36h9086845_0  
networkx                  2.3                        py_0  
numpy                     1.16.2           py36h19fb1c0_0  
numpy-base                1.16.2           py36hc3f5095_0  
nvidia-ml-py3             7.352.0                   <pip>
olefile                   0.46                     py36_0  
opencv-python             4.1.0.25                  <pip>
openssl                   1.1.1b               he774522_1  
pathlib                   1.0.1                    py36_1  
pbr                       5.1.3                      py_0  
pillow                    6.0.0            py36hdc69c19_0  
pip                       19.1.1                   py36_0  
protobuf                  3.7.1            py36h33f27b4_0  
psutil                    5.6.2            py36he774522_0  
pyparsing                 2.4.0                      py_0  
pyqt                      5.9.2            py36h6538335_2  
pyreadline                2.1                      py36_1  
python                    3.6.8                h9f7ef89_7  
python-dateutil           2.8.0                    py36_0  
pytz                      2019.1                     py_0  
pywavelets                1.0.3            py36h8c2d366_1  
pyyaml                    5.1              py36he774522_0  
qt                        5.9.7            vc14h73c81de_0  
scikit-image              0.15.0           py36ha925a31_0  
scikit-learn              0.20.3           py36h343c172_0  
scipy                     1.2.1            py36h29ff71c_0  
setuptools                41.0.1                   py36_0  
sip                       4.19.8           py36h6538335_0  
six                       1.12.0                   py36_0  
sqlite                    3.28.0               he774522_0  
tensorboard               1.12.2           py36h33f27b4_0  
tensorflow                1.12.0          gpu_py36ha5f9131_0  
tensorflow-base           1.12.0          gpu_py36h6e53903_0  
tensorflow-estimator      1.13.0                     py_0  
tensorflow-gpu            1.12.0               h0d30ee6_0  
termcolor                 1.1.0                    py36_1  
tk                        8.6.8                hfa6e2cd_0  
toolz                     0.9.0                    py36_0  
toposort                  1.5                       <pip>
tornado                   6.0.2            py36he774522_0  
tqdm                      4.31.1                   py36_1  
vc                        14.1                 h0510ff6_4  
vs2015_runtime            14.15.26706          h3a45250_4  
werkzeug                  0.15.2                     py_0  
wheel                     0.33.2                   py36_0  
wincertstore              0.2              py36h7fe50ca_0  
xz                        5.2.4                h2fa13f4_4  
yaml                      0.1.7                hc54c509_2  
zlib                      1.2.11               h62dcd97_3  
zstd                      1.3.7                h508b16e_0  
torzdf commented 5 years ago

I would say that your model has corrupted. This is an h5py error.