Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset and Code Error #3

Open
good-demo opened this issue Jul 28, 2024 · 3 comments
Open

Dataset and Code Error #3

good-demo opened this issue Jul 28, 2024 · 3 comments

Comments

@good-demo
Copy link

Thank you for sharing your work,i am currently facing issues with the dataset
About SoftCLT + TS2Vec Semi-supervised Classification
The data preparation was not specified,is there a relevant script to handle this segmented data?

Transfer Learning
Source dataset: SleepEEG this data preparation was also not specified

@good-demo
Copy link
Author

Use SleepEDF as Source dataset
Traceback (most recent call last):
File "main_pretrain_TL.py", line 102, in
Trainer_wo_DTW_wo_val(args, model, temporal_contr_model, model_optimizer,
File "/mnt/share/yxd/softclt-main/softclt_catcc/trainer/trainer.py", line 228, in Trainer_wo_DTW_wo_val
train_loss, train_acc = model_train_wo_DTW(dist_func, args.dist, args.tau_inst, model, temporal_contr_model, model_optimizer, temp_cont_optimizer,
File "/mnt/share/yxd/softclt-main/softclt_catcc/trainer/train_utils.py", line 123, in model_train_wo_DTW
_, _, features1, features2, final_loss = model(aug1, aug2, dist_mat_batch)
File "/mnt/share/yxd/envs/order/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in call_impl
return forward_call(*args, **kwargs)
File "/mnt/share/yxd/softclt-main/softclt_catcc/models/model.py", line 63, in forward
temporal_loss += (1-self.lambda
) * temp_CL_soft(aug1, aug2, timelag_L, timelag_R)
File "/mnt/share/yxd/softclt-main/softclt_catcc/models/soft_losses.py", line 47, in temp_CL_soft
loss = torch.sum(logits[:,t]*timelag_L)
RuntimeError: The size of tensor a (63) must match the size of tensor b (3001) at non-singleton dimension 2

@good-demo
Copy link
Author

Is it due to incorrect data or code errors

@good-demo good-demo changed the title About dataset Dataset and Code Error Jul 29, 2024
@WUT-YYN
Copy link

WUT-YYN commented Nov 11, 2024

使用 SleepEDF 作为源数据 集回溯(最近一次调用最后一次): 文件“main_pretrain_TL.py”,第 102 行,在 Trainer_wo_DTW_wo_val(args, model, temporary_contr_model, model_optimizer, 文件“/mnt/share/yxd/softclt-main/softclt_catcc/trainer/trainer.py”,第 228 行,在 Trainer_wo_DTW_wo_val train_loss, train_acc = model_train_wo_DTW(dist_func, args.dist, args.tau_inst, model, temporary_contr_model, model_optimizer, temp_cont_optimizer, 文件“/mnt/share/yxd/softclt-main/softclt_catcc/trainer/train_utils.py”,第 123 行,在 model_train_wo_DTW _, , features1, features2, final_loss =模型(aug1、aug2、dist_mat_batch) 文件“/mnt/share/yxd/envs/order/lib/python3.8/site-packages/torch/nn/modules/module.py”,第 1501 行,在_call_impl中 返回 forward_call(*args,**kwargs) 文件“/mnt/share/yxd/softclt-main/softclt_catcc/models/model.py”,第 63 行,在前向 temporary_loss +=(1-self.lambda)* temp_CL_soft(aug1、aug2、timelag_L、timelag_R) 文件“/mnt/share/yxd/softclt-main/softclt_catcc/models/soft_losses.py”,第 47 行,在 temp_CL_soft 中 loss = torch.sum(logits[:,t]*timelag_L) RuntimeError:大小张量 a (63) 必须与非单维 2 上的张量 b (3001) 的大小匹配

I also encountered this problem, has it been solved? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants