Open xingjianz opened 2 years ago
I have the same issue. Have you fixed it ?
@namisan when set adv_train, I also have this issue. Do you have any solution?
Traceback (most recent call last):
File "train.py", line 776, in <module>
main()
File "train.py", line 663, in main
model.update(batch_meta, batch_data)
File "/home/tunguyen6/Test/text_similarity/mt-dnn/mt_dnn/model.py", line 327, in update
adv_loss, emb_val, eff_perturb = self.adv_teacher.forward(*adv_inputs)
File "/home/tunguyen6/Test/text_similarity/mt-dnn/mt_dnn/perturbation.py", line 124, in forward
(delta_grad,) = torch.autograd.grad(
File "/home/tunguyen6/.local/lib/python3.8/site-packages/torch/autograd/__init__.py", line 226, in grad
return Variable._execution_engine.run_backward(
RuntimeError: One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior.
can you share me your python/pytorch version? You can direct pull my docker to run the experiment.
hi @namisan torch 1.9.1 and python 3.8.10
I was trying to finetune on STS-B using SMART like follows:
python ../train.py --task_def ../experiments/glue/glue_task_def.yml --data_dir ${DATA_DIR} --init_checkpoint ${BERT_PATH} --batch_size ${BATCH_SIZE} --output_dir ${model_dir} --log_file ${log_file} --train_datasets ${train_datasets} --test_datasets ${test_datasets} --adv_train --adv_opt 1
The following error pops out.RuntimeError: Boolean value of Tensor with more than one value is ambiguous'
I think the problem is that at line 106 of perturbation.py:
The arguments do not match the forward function at line 165 in matcher.py:
I think the 'y_input_ids' is missing in perturbation.py but I am not sure how to fix it. Any solutions or suggestions? Thanks!