private-data-generation icon indicating copy to clipboard operation
private-data-generation copied to clipboard

RuntimeError: Sizes of tensors must match except in dimension 0.

Open juliecious opened this issue 4 years ago • 0 comments

Hi,

I got this error message when running pate-gan with the breast cancer dataset.

Traceback (most recent call last): File "evaluate.py", line 144, in <module> lap_scale=opt.lap_scale, class_ratios=class_ratios, lr=1e-4)) File "/content/private-data-generation/models/pate_gan.py", line 104, in train fake = self.generator(torch.cat([z.double(), category], dim=1)) RuntimeError: Sizes of tensors must match except in dimension 0. Got 45 and 64 (The offending index is 0)

I have made sure to drop all the nan values and the values in the dataset are continuous. Could you please shed some light on the issue?

Here's my code of running pate-gan

python evaluate.py --target-variable='target' \ --train-data-path=./data/breast_processed_train.csv \ --test-data-path=./data/breast_processed_test.csv \ --normalize-data pate-gan --enable-privacy \ --target-epsilon=1

juliecious avatar Aug 16 '21 09:08 juliecious