Tian0426 / CL-HAR

56 stars 10 forks source link

I noticed an issue , how to train an encoder network for supervised setting for --cases subject or --cases subject_large #5

Closed ashwinj92 closed 2 years ago

ashwinj92 commented 2 years ago

Hi,

First of all the framework is very well written and rounded. However I was trying to train the model under supervised setting under --cases subject.

I noticed the following:

The command used python main_supervised_baseline.py --batch_size 64 --lr 1e-4 --cases subject --dataset ucihar --backbone AE

File "C:\Users\mydoc\OneDrive\Documents\KDD-HAR code\CL-HAR-main\CL-HAR-main\main_supervised_baseline.py", line 234, in <module> best_model = train(args, train_loaders, val_loader, model, DEVICE, optimizer, criterion) File "C:\Users\mydoc\OneDrive\Documents\KDD-HAR code\CL-HAR-main\CL-HAR-main\main_supervised_baseline.py", line 102, in train for idx, (sample, target, domain) in enumerate(val_loader): TypeError: 'NoneType' object is not iterable

Thank you.

Tian0426 commented 2 years ago

Hi @ashwinj92,

Thank you for your comments!

The val_loader in subject case is None by default. We have fixed this error by ignoring NoneType val_loader. It should work now. Hope this helps!

ashwinj92 commented 2 years ago

Thank you Tian0426. The updates made resolved the issue.