RL-GAN-Net icon indicating copy to clipboard operation
RL-GAN-Net copied to clipboard

AssertionError: X and Y should be the same shape

Open ghost opened this issue 5 years ago • 3 comments

Hello while I was training the autoenconder I encoder this error message shown below: Have you ever encountered this error while training?

. . . Epoch: [0][0/361] Batch Time: 0.202 (0.202) sec Loss: 0.05724537745118141 Traceback (most recent call last): File "main2.py", line 489, in <module> main() File "main2.py", line 294, in main valid_loss, _, _ = validation(test_loader,model,epoch,args,chamfer,vis_Valid,vis_Valida,valid_writer) File "main2.py", line 407, in validation vis_Valid.plot_current_errors(epoch, float(i) / epoch_size, args, errors) File "/home/paolo/Documents/Git/RL-GAN-Net/visualizer.py", line 79, in plot_current_errors win=self.display_id) File "/home/paolo/anaconda3/envs/rlgan-venv/lib/python3.7/site-packages/visdom/__init__.py", line 389, in wrapped_f return f(*args, **kwargs) File "/home/paolo/anaconda3/envs/rlgan-venv/lib/python3.7/site-packages/visdom/__init__.py", line 1694, in line assert X.shape == Y.shape, 'X and Y should be the same shape' AssertionError: X and Y should be the same shape

ghost avatar Sep 24 '19 06:09 ghost

Hey! Did you manage to fix this issue?

inFocus7 avatar Mar 10 '20 15:03 inFocus7

Hey! Did you manage to fix this issue?

Hello~ Have you fixed it?

xcc13 avatar Jun 15 '20 13:06 xcc13

I managed to fix this error by following changes to the /anaconda3/envs/RL-GAN/lib/python3.6/site-packages/visdom/init.py : ` if Y.ndim == 2 and Y.shape[1] == 1:

Y = Y.reshape(Y.shape[0]) # instead of Y = Y.reshape(1, Y.shape[0])

X = X.reshape(X.shape[0]) ` ...

opts['markers'] = True if Y.ndim == 1 else opts.get('markers', False)

huynhtnhut97 avatar May 11 '22 06:05 huynhtnhut97