Skip to content

Code issue #4

@pzw1231

Description

@pzw1231

I run the following code:

python train.py --dataset foods --split_ratio 0.25 --seed 0
--train_type base
--backbone bert --classifier_type softmax --optimizer adam_vanilla \

Encountered the following problem:

Loading pre-trained backbone network...
Initializing dataset and model...
Initializing base dataset... (name: foods)
Training model...
Traceback (most recent call last):
File "train.py", line 109, in
main()
File "train.py", line 75, in main
train_base(args, train_loader, model, optimizer, epoch)
File "/home/bigdata11/pzw/MASKER/training/base.py", line 27, in train_base
out_cls = model(tokens) # (B, C)
File "/home/bigdata11/anaconda3/envs/pzw/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/bigdata11/pzw/MASKER/models.py", line 48, in forward
out_p = self.dropout(out_p)
File "/home/bigdata11/anaconda3/envs/pzw/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/bigdata11/anaconda3/envs/pzw/lib/python3.6/site-packages/torch/nn/modules/dropout.py", line 58, in forward
return F.dropout(input, self.p, self.training, self.inplace)
File "/home/bigdata11/anaconda3/envs/pzw/lib/python3.6/site-packages/torch/nn/functional.py", line 983, in dropout
else _VF.dropout(input, p, training))
TypeError: dropout(): argument 'input' (position 1) must be Tensor, not str

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions