alvinchangw / COCON_ICLR2021

Pytorch implementation of CoCon: A Self-Supervised Approach for Controlled Text Generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'cocon_block' has no attribute 'cocon_attn'

wying8349 opened this issue · comments

We meet a problem like this:
Traceback (most recent call last):
File "traininfer_cocon.py", line 2980, in
main()
File "traininfer_cocon.py", line 2783, in main
global_step, tr_loss = train_cocon(args, train_dataset, model, tokenizer, cocon_block=cocon_block, disc_model=disc_model, model_config=config, transform_h_after_layernorm=args.transform_h_after_layernorm)
File "traininfer_cocon.py", line 573, in train_cocon
self_cocon_lm_loss_grad = torch.autograd.grad(self_cocon_lm_loss, cocon_block.cocon_attn.c_attn.weight, retain_graph=True)[0]
File "/home/yingwenjing/anaconda3/envs/cocon/lib/python3.7/site-packages/torch/nn/modules/module.py", line 576, in getattr
type(self).name, name))
AttributeError: 'DataParallel' object has no attribute 'cocon_attn'

We sincerely look forward to your reply.

commented

I have same question

I have the same question when running "traininfer_cocon.py"