Jireh-Jam / R-MNet-Inpainting-keras

R-MNET: A Perceptual Adversarial Network for Image Inpainting model in Keras
23 stars 6 forks source link

Invalid argument: You must feed a value for placeholder tensor 'lambda_5_target' with dtype float and shape [?,?,?,?] #3

Closed doulemint closed 3 years ago

doulemint commented 3 years ago

2021-02-04 17:55:58.117804: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:196] None of the MLIR optimization passes are enabled (registered 0 passes) 2021-02-04 17:55:58.135234: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 2199995000 Hz (?, 256, 256, 1) (?, 256, 256, 3) Traceback (most recent call last): File "run.py", line 15, in

r_mnetwgan = RMNETWGAN(config)

File "/content/drive/My Drive/project/R-MNet-Inpainting-keras/rmnet.py", line 118, in init

self.combined.compile(loss=[self.generator_loss(mask), self.wasserstein_loss],loss_weights=[1,0.001], optimizer=self.g_optimizer)

File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/tracking/base.py", line 517, in _method_wrapper result = method(self, *args, *kwargs) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_v1.py", line 457, in compile self._compile_weights_loss_and_weighted_metrics() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/tracking/base.py", line 517, in _method_wrapper result = method(self, args, kwargs) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_v1.py", line 1543, in _compile_weights_loss_and_weighted_metrics self.total_loss = self._prepare_total_loss(masks) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_v1.py", line 1603, in _prepare_total_loss per_sample_losses = loss_fn.call(y_true, y_pred) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/losses.py", line 256, in call return ag_fn(y_true, y_pred, self._fn_kwargs) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/autograph/impl/api.py", line 670, in wrapper raise e.ag_error_metadata.to_exception(e) tensorflow.python.framework.errors_impl.InvalidArgumentError: in user code: /content/drive/My Drive/project/R-MNet-Inpainting-keras/rmnet.py:138 loss *

    masking = Multiply()([reversed_mask,input_img])

/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer_v1.py:751 __call__  **
    base_layer_utils.create_keras_history(inputs)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer_utils.py:188 create_keras_history
    _, created_layers = _create_keras_history_helper(tensors, set(), [])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer_utils.py:250 _create_keras_history_helper
    constants[i] = backend.function([], op_input)([])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/backend.py:3957 __call__
    run_metadata=self.run_metadata)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py:1482 __call__
    run_metadata_ptr)

InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument: You must feed a value for placeholder tensor 'lambda_5_target' with dtype float and shape [?,?,?,?]
     [[{{node lambda_5_target}}]]
     [[lambda_5_target/_353]]
  (1) Invalid argument: You must feed a value for placeholder tensor 'lambda_5_target' with dtype float and shape [?,?,?,?]
     [[{{node lambda_5_target}}]]
0 successful operations.
0 derived errors ignored.

I highlighted where the error occurred. I disable the multiple_gpu_model. So it was running expect part in this code. Is anyone has the same error as me?

Jireh-Jam commented 3 years ago

Please ensure you have the right Keras version installed as per the Readme file.