Hello,
I tried ECLARE model on custom dataset for multilabel classification task. I encountered the following error after running the code:
Traceback (most recent call last):
File "/root/scratch/XC/programs/ECLARE/ECLARE/main.py", line 213, in
main(args.params)
File "/root/scratch/XC/programs/ECLARE/ECLARE/main.py", line 194, in main
train(model, params)
File "/root/scratch/XC/programs/ECLARE/ECLARE/main.py", line 58, in train
model.fit(
File "/root/scratch/XC/programs/ECLARE/ECLARE/libs/model_base.py", line 373, in fit
self._fit(train_dataset, valid, model_dir, result_dir, validate_after)
File "/root/scratch/XC/programs/ECLARE/ECLARE/libs/model_base.py", line 305, in _fit
self._train_depth(train_ds, valid_ds, model_dir,
File "/root/scratch/XC/programs/ECLARE/ECLARE/libs/model_base.py", line 288, in _train_depth
tr_avg_loss = self._step(train_dl)
File "/root/scratch/XC/programs/ECLARE/ECLARE/libs/model_base.py", line 196, in _step
loss = self._compute_loss(out_ans, batch_data)
File "/root/scratch/XC/programs/ECLARE/ECLARE/libs/model_base.py", line 183, in _compute_loss
return self.criterion(out_ans, _true).to(device)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/loss.py", line 713, in forward
return F.binary_cross_entropy_with_logits(input, target,
File "/usr/local/lib/python3.8/dist-packages/torch/nn/functional.py", line 3130, in binary_cross_entropy_with_logits
raise ValueError("Target size ({}) must be the same as input size ({})".format(target.size(), input.size()))
I have no idea why the target size mismatch the input size?!
Many thanks in advance.