ocampor / image-quality

Image quality is an open source software library for Image Quality Assessment (IQA).
Apache License 2.0
385 stars 84 forks source link

LIVE Database - InvalidArgumentError: Incompatible shapes: [1,512,640,1] vs. [1,512,768,1] #37

Open SuperBruceJia opened 3 years ago

SuperBruceJia commented 3 years ago

Describe the bug Incompatible shapes of distorted image and reference image e.g., [1,512,640,1] vs. [1,512,768,1] Additional context

Generating splits...:   0%|          | 0/1 [00:00<?, ? splits/s]
Generating train examples...: 0 examples [00:00, ? examples/s]
Generating train examples...: 19 examples [00:00, 181.01 examples/s]
Generating train examples...: 38 examples [00:00, 149.12 examples/s]
Generating train examples...: 60 examples [00:00, 174.94 examples/s]
Generating train examples...: 82 examples [00:00, 188.24 examples/s]
Generating train examples...: 104 examples [00:00, 198.14 examples/s]
Generating train examples...: 126 examples [00:00, 204.00 examples/s]
Generating train examples...: 147 examples [00:00, 201.46 examples/s]
Generating train examples...: 169 examples [00:00, 205.96 examples/s]
Generating train examples...: 192 examples [00:00, 212.83 examples/s]
Generating train examples...: 214 examples [00:01, 211.54 examples/s]
Generating train examples...: 236 examples [00:01, 208.02 examples/s]
Generating train examples...: 257 examples [00:01, 206.73 examples/s]
Generating train examples...: 280 examples [00:01, 212.56 examples/s]
Generating train examples...: 303 examples [00:01, 216.27 examples/s]
Generating train examples...: 325 examples [00:01, 216.36 examples/s]
Generating train examples...: 347 examples [00:01, 216.33 examples/s]
Generating train examples...: 369 examples [00:01, 212.84 examples/s]
Generating train examples...: 391 examples [00:01, 214.28 examples/s]
Generating train examples...: 414 examples [00:02, 217.33 examples/s]
Generating train examples...: 437 examples [00:02, 217.85 examples/s]
Generating train examples...: 460 examples [00:02, 219.43 examples/s]
Generating train examples...: 483 examples [00:02, 219.75 examples/s]
Generating train examples...: 505 examples [00:02, 88.23 examples/s] 
Generating train examples...: 537 examples [00:03, 120.89 examples/s]
Generating train examples...: 566 examples [00:03, 149.55 examples/s]
Generating train examples...: 596 examples [00:03, 178.65 examples/s]
Generating train examples...: 629 examples [00:03, 210.29 examples/s]
Generating train examples...: 660 examples [00:03, 232.55 examples/s]
Generating train examples...: 689 examples [00:03, 234.80 examples/s]
Generating train examples...: 720 examples [00:03, 253.02 examples/s]
Generating train examples...: 749 examples [00:03, 258.52 examples/s]
Generating train examples...: 779 examples [00:03, 268.77 examples/s]
Generating train examples...: 809 examples [00:03, 275.49 examples/s]
Generating train examples...: 838 examples [00:04, 276.63 examples/s]
Generating train examples...: 867 examples [00:04, 278.53 examples/s]
Generating train examples...: 896 examples [00:04, 275.07 examples/s]
Generating train examples...: 925 examples [00:04, 278.95 examples/s]
Generating train examples...: 955 examples [00:04, 284.23 examples/s]

Shuffling live_iqa-train.tfrecord...:   0%|          | 0/982 [00:00<?, ? examples/s]
Shuffling live_iqa-train.tfrecord...:   1%|          | 8/982 [00:00<00:12, 77.93 examples/s]
Shuffling live_iqa-train.tfrecord...:   3%|▎         | 25/982 [00:00<00:09, 103.51 examples/s]
Shuffling live_iqa-train.tfrecord...:   5%|▌         | 54/982 [00:00<00:05, 174.77 examples/s]
Shuffling live_iqa-train.tfrecord...:  10%|▉         | 95/982 [00:00<00:03, 258.37 examples/s]
Shuffling live_iqa-train.tfrecord...:  14%|█▍        | 138/982 [00:00<00:02, 312.05 examples/s]
Shuffling live_iqa-train.tfrecord...:  18%|█▊        | 179/982 [00:00<00:02, 342.56 examples/s]
Shuffling live_iqa-train.tfrecord...:  23%|██▎       | 222/982 [00:00<00:02, 367.32 examples/s]
Shuffling live_iqa-train.tfrecord...:  27%|██▋       | 262/982 [00:00<00:01, 376.23 examples/s]
Shuffling live_iqa-train.tfrecord...:  31%|███       | 304/982 [00:00<00:01, 386.46 examples/s]
Shuffling live_iqa-train.tfrecord...:  35%|███▌      | 345/982 [00:01<00:01, 392.81 examples/s]
Shuffling live_iqa-train.tfrecord...:  39%|███▉      | 387/982 [00:01<00:01, 399.83 examples/s]
Shuffling live_iqa-train.tfrecord...:  44%|████▎     | 428/982 [00:01<00:01, 402.38 examples/s]
Shuffling live_iqa-train.tfrecord...:  48%|████▊     | 471/982 [00:01<00:01, 409.98 examples/s]
Shuffling live_iqa-train.tfrecord...:  52%|█████▏    | 513/982 [00:01<00:01, 412.85 examples/s]
Shuffling live_iqa-train.tfrecord...:  57%|█████▋    | 555/982 [00:01<00:01, 410.27 examples/s]
Shuffling live_iqa-train.tfrecord...:  61%|██████    | 597/982 [00:01<00:00, 406.66 examples/s]
Shuffling live_iqa-train.tfrecord...:  65%|██████▌   | 639/982 [00:01<00:00, 408.25 examples/s]
Shuffling live_iqa-train.tfrecord...:  69%|██████▉   | 680/982 [00:01<00:00, 307.49 examples/s]
Shuffling live_iqa-train.tfrecord...:  73%|███████▎  | 715/982 [00:02<00:00, 317.52 examples/s]
Shuffling live_iqa-train.tfrecord...:  77%|███████▋  | 752/982 [00:02<00:00, 329.31 examples/s]
Shuffling live_iqa-train.tfrecord...:  81%|████████  | 793/982 [00:02<00:00, 349.73 examples/s]
Shuffling live_iqa-train.tfrecord...:  85%|████████▌ | 836/982 [00:02<00:00, 371.06 examples/s]
Shuffling live_iqa-train.tfrecord...:  89%|████████▉ | 875/982 [00:02<00:00, 334.28 examples/s]
Shuffling live_iqa-train.tfrecord...:  93%|█████████▎| 913/982 [00:02<00:00, 345.93 examples/s]
Shuffling live_iqa-train.tfrecord...:  97%|█████████▋| 953/982 [00:02<00:00, 358.83 examples/s]
Dataset live_iqa downloaded and prepared to /home/shuyuej/tensorflow_datasets/live_iqa/1.0.0. Subsequent calls will reuse this data.
Model: "objective_error_map"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
original_image (InputLayer)  [(1, None, None, 1)]      0         
_________________________________________________________________
Conv1 (Conv2D)               (1, None, None, 48)       480       
_________________________________________________________________
Conv2 (Conv2D)               (1, None, None, 48)       20784     
_________________________________________________________________
Conv3 (Conv2D)               (1, None, None, 64)       27712     
_________________________________________________________________
Conv4 (Conv2D)               (1, None, None, 64)       36928     
_________________________________________________________________
Conv5 (Conv2D)               (1, None, None, 64)       36928     
_________________________________________________________________
Conv6 (Conv2D)               (1, None, None, 64)       36928     
_________________________________________________________________
Conv7 (Conv2D)               (1, None, None, 128)      73856     
_________________________________________________________________
Conv8 (Conv2D)               (1, None, None, 128)      147584    
_________________________________________________________________
Conv9 (Conv2D)               (1, None, None, 1)        129       
=================================================================
Total params: 381,329
Trainable params: 381,329
Non-trainable params: 0
___________________________________________________________
step 0: mean loss = tf.Tensor(6.102439, shape=(), dtype=float32)
step 100: mean loss = tf.Tensor(0.8519581, shape=(), dtype=float32)
step 200: mean loss = tf.Tensor(0.7548247, shape=(), dtype=float32)
step 300: mean loss = tf.Tensor(0.7112402, shape=(), dtype=float32)
step 400: mean loss = tf.Tensor(0.6846403, shape=(), dtype=float32)
step 500: mean loss = tf.Tensor(0.65744716, shape=(), dtype=float32)
step 600: mean loss = tf.Tensor(0.64582705, shape=(), dtype=float32)
step 700: mean loss = tf.Tensor(0.62755895, shape=(), dtype=float32)
Traceback (most recent call last):
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/eager/context.py", line 1986, in execution_mode
    yield
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 652, in _next_internal
    ret = gen_dataset_ops.iterator_get_next(
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/ops/gen_dataset_ops.py", line 2363, in iterator_get_next
    _ops.raise_from_not_ok_status(e, name)
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 6653, in raise_from_not_ok_status
    six.raise_from(core._status_to_exception(e.code, message), None)
  File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,512,640,1] vs. [1,512,768,1]
     [[{{node sub_7}}]] [Op:IteratorGetNext]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shuyuej/Desktop/Codes/DIQA/notebooks/train-LIVE.py", line 128, in <module>
    for I_d, e_gt, r in train:
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 631, in __next__
    return self.next()
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 670, in next
    return self._next_internal()
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 661, in _next_internal
    return structure.from_compatible_tensor_list(self._element_spec, ret)
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/eager/context.py", line 1989, in execution_mode
    executor_new.wait()
  File "/home/shuyuej/.conda/envs/tf2/lib/python3.8/site-packages/tensorflow/python/eager/executor.py", line 67, in wait
    pywrap_tfe.TFE_ExecutorWaitForAllPendingNodes(self._handle)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,512,640,1] vs. [1,512,768,1]
ocampor commented 3 years ago

This is a weird one, I will look and let you know if I find a solution. If you find the solution before, could you share it here so the rest of the people can see it? Thanks