Skip to content

AttributeError: 'PTuneForLAMA' object has no attribute 'prompt' #16

Description

@puraminy

I called

python cli.py --model_name=gpt2

After several epochs, it printed the following error:

P1001 Dev Epoch 41 Loss: 0.007320404052734375 Hit@1: 0.6756756756756757
Traceback (most recent call last):
  File "cli.py", line 238, in <module>
    main()
  File "cli.py", line 234, in main
    trainer.train()
  File "cli.py", line 197, in train
    self.save(best_ckpt)
  File "cli.py", line 171, in save
    print("# Prompt:", self.model.prompt)
  File "/home/pouramini/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", 
line 948, in __getattr__
    type(self).__name__, name))
AttributeError: 'PTuneForLAMA' object has no attribute 'prompt'

Activity

  1. aaafc commented on Sep 28, 2021

    @aaafc

    Yes, I've encountered the problem myself, and I'm still looking for the reason.
    I've used GPT-2 as my PLM as well, and after 46 epochs, the same error occurs at line "cli.py, line 171" in the script.
    Though I'm not sure why this is taken place, it appears that one can simply comment out that line, and the script still works.
    So, if you are just trying to run the process, you could simply skip the code which seems to just print another line of debug info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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