mims-harvard / Raincoat

Domain Adaptation for Time Series Under Feature and Label Shifts
https://zitniklab.hms.harvard.edu/projects/Raincoat
MIT License
107 stars 11 forks source link

Can only run the HAR dataset; encountering errors when running other datasets. #9

Open lllllllwdwd opened 11 months ago

lllllllwdwd commented 11 months ago

For the Sleep-EDF dataset, the following error is reported: Traceback (most recent call last): File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/main.py", line 37, in trainer.train() File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/trainers/trainer.py", line 113, in train losses = algorithm.update(src_x, src_y, trg_x) File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/algorithms/RAINCOAT.py", line 161, in update src_feat, out_s = self.feature_extractor(src_x)
File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/algorithms/RAINCOAT.py", line 110, in forward ef = F.relu(self.bn_freq(self.avg(ef).squeeze())) File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, **kwargs) File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 182, in forward self.eps, File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/functional.py", line 2451, in batch_norm input, weight, bias, running_mean, running_var, training, momentum, eps, torch.backends.cudnn.enabled RuntimeError: running_mean should contain 100 elements not 600

For the HHAR dataset, the following error is reported: Traceback (most recent call last): File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/main.py", line 37, in trainer.train() File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/trainers/trainer.py", line 113, in train losses = algorithm.update(src_x, src_y, trg_x) File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/algorithms/RAINCOAT.py", line 174, in update src_pred = self.classifier(src_feat) File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/models/models.py", line 70, in forward predictions = self.logits(x)/self.tmp File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, **kwargs) File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 114, in forward return F.linear(input, self.weight, self.bias) RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x192 and 128x6)

For the WISDM dataset, the following error is reported: Traceback (most recent call last): File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/main.py", line 37, in trainer.train() File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/trainers/trainer.py", line 113, in train losses = algorithm.update(src_x, src_y, trg_x) File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/algorithms/RAINCOAT.py", line 174, in update src_pred = self.classifier(src_feat) File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/media/qiu/DataDisk/yue/Raincoat-main (1)/Raincoat-main/models/models.py", line 70, in forward predictions = self.logits(x)/self.tmp File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, **kwargs) File "/home/qiu/anaconda3/envs/sleepstage/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 114, in forward return F.linear(input, self.weight, self.bias) RuntimeError: mat1 and mat2 shapes cannot be multiplied (64x256 and 192x6)

Could you please clarify whether there are any parameters that haven't been set, or if there might be some other reasons for this issue?

jaeho3690 commented 1 month ago

It seems like the bug comes from the mismatch in features.out_dim size. However, even after fixing the error, I face the below problem.

스크린샷 2024-10-15 오후 2 18 38
jaeho3690 commented 1 month ago

even the example.ipynb code shows the exact same error.

스크린샷 2024-10-15 오후 2 23 05