DeepLearningSmells icon indicating copy to clipboard operation
DeepLearningSmells copied to clipboard

Is "ValueError: Dimensions must be equal" normal?

Open minhnbvnu opened this issue 5 months ago • 1 comments

Thank you for the awesome project!

I was trying to run this project on my own and ran into an issue, can you please check it out:

Epoch 1/20
in user code:

    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/engine/training.py", line 1284, in train_function  *
        return step_function(self, iterator)
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/engine/training.py", line 1268, in step_function  **
        outputs = model.distribute_strategy.run(run_step, args=(data,))
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/engine/training.py", line 1249, in run_step  **
        outputs = model.train_step(data)
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/engine/training.py", line 1051, in train_step
        loss = self.compute_loss(x, y, y_pred, sample_weight)
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/engine/training.py", line 1109, in compute_loss
        return self.compiled_loss(
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/engine/compile_utils.py", line 265, in __call__
        loss_value = loss_obj(y_t, y_p, sample_weight=sw)
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/losses.py", line 142, in __call__
        losses = call_fn(y_true, y_pred)
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/losses.py", line 268, in call  **
        return ag_fn(y_true, y_pred, **self._fn_kwargs)
    File "/Users/nguyenbinhminh/miniconda3/envs/deepsmells/lib/python3.9/site-packages/keras/losses.py", line 1470, in mean_squared_error
        return backend.mean(tf.math.squared_difference(y_pred, y_true), axis=-1)

    ValueError: Dimensions must be equal, but are 700 and 714 for '{{node mean_squared_error/SquaredDifference}} = SquaredDifference[T=DT_FLOAT](model_107/dense_131/Relu, IteratorGetNext:1)' with input shapes: [?,700,1], [?,714,1].

Here are the steps:

  • I don't have a super strong computer so I created a very small subset of your ComplexMethod data ComplexMethod.zip
  • I modified autoencoder.py to run only ComplexMethod smell
  • I ran python3 autoencoder.py from program/dl_models folder

Sorry for my poor English, if you need more information please ask!

minhnbvnu avatar Jan 28 '24 07:01 minhnbvnu