PyTorch-Model-Compare icon indicating copy to clipboard operation
PyTorch-Model-Compare copied to clipboard

Bug with num_batches?

Open catalys1 opened this issue 2 years ago • 1 comments

It looks like there's a subtle bug on this line: https://github.com/AntixK/PyTorch-Model-Compare/blob/main/torch_cka/cka.py#L156

num_batches = min(len(dataloader1), len(dataloader1))

len(dataloader1) is in there twice, I assume it's supposed to be

num_batches = min(len(dataloader1), len(dataloader2))

catalys1 avatar Sep 07 '23 17:09 catalys1

It looks like there's a subtle bug on this line: https://github.com/AntixK/PyTorch-Model-Compare/blob/main/torch_cka/cka.py#L156

num_batches = min(len(dataloader1), len(dataloader1))

len(dataloader1) is in there twice, I assume it's supposed to be

num_batches = min(len(dataloader1), len(dataloader2))

It seems rational, it could support such mechanism. However, I usually compare two models by using the same dataset.

HuangChiEn avatar Dec 25 '23 06:12 HuangChiEn