llu025 / Heterogeneous_CD

This repository contains the software developed for the project of Heterogeneous Change Detection in Remote Sensing Images.
107 stars 39 forks source link

cGAN: dimensionality inconsistency occurs #19

Open PradeepYLN opened 3 months ago

PradeepYLN commented 3 months ago

Thank you for sharing the code with the public. I'm trying to execute the cGAN.py script and encountered the following error Could you please help me resolve the issue?

███| 1/1 [00:07<00:00, 7.45s/it] 6%|▋ | 12/200 [01:40<26:11, 8.36s/it] Traceback (most recent call last): File "cGAN.py", line 265, in test("Texas") File "cGAN.py", line 240, in test TRAIN = tf.data.Dataset.from_tensor_slices(tuple(dataset)) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 830, in from_tensor_slices return from_tensor_slices_op._from_tensor_slices(tensors, name) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/data/ops/from_tensor_slices_op.py", line 25, in _from_tensor_slices return _TensorSliceDataset(tensors, name=name) File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/data/ops/from_tensor_slices_op.py", line 45, in init batch_dim.assert_is_compatible_with( File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/tensor_shape.py", line 298, in assert_is_compatible_with raise ValueError("Dimensions %s and %s are not compatible" % ValueError: Dimensions 49266 and 1231650 are not compatible

llu025 commented 3 months ago

Hello, unfortunately I am on holidays and I will not be able to reply before October, since I am gone for a month. I cannot see much from the error, I remember that after some epochs there is some operation that updates a variable (probability of no change Pu I think?) and then the whole dataset has to be formed again and that's where your issue is. There is some reshape that does not go as planned. I would have to investigate a bit, and I really don't have the time now, sorry 😔

PradeepYLN commented 3 months ago

Have a nice vacation! Thank you for providing details on the possible issue. In the meantime, I'll try to debug it from my side. Thanks again!