ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[BUG]: AttributeError: type object 'Trainer' has no attribute 'add_argparse_args'

Open pariskang opened this issue 1 year ago • 1 comments

🐛 Describe the bug

Description:

When I running the command "python main.py --logdir /tmp/ -t -b configs/Teyvat/train_colossalai_teyvat.yaml" to rekoad the diffusion model, I encountered the following error:

AttributeError: type object 'Trainer' has no attribute 'add_argparse_args' Steps to Reproduce:

Clone the repository. Run the command "python main.py --logdir /tmp/ -t -b configs/Teyvat/train_colossalai_teyvat.yaml". Expected Behavior:

The command should run without any errors.

Actual Behavior:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /root/ColossalAI/examples/images/diffusion/main.py:535 in │ │ │ │ 532 │ sys.path.append(os.getcwd()) │ │ 533 │ │ │ 534 │ parser = get_parser() │ │ ❱ 535 │ parser = Trainer.add_argparse_args(parser) │ │ 536 │ │ │ 537 │ opt, unknown = parser.parse_known_args() │ │ 538 │ if opt.name and opt.resume: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: type object 'Trainer' has no attribute 'add_argparse_args'

Additional Context:

The error message suggests that there is a problem with the "Trainer" object and its "add_argparse_args" attribute. Can u help me to resolve it. Thank u.

Environment

No response

pariskang avatar Feb 28 '23 07:02 pariskang

Sorry, we are fixing on it.

MichelleMa8 avatar Mar 07 '23 07:03 MichelleMa8

Hello, could I know your version of lightning in your environment?

I had the same "AttributeError: type object 'Trainer' has no attribute 'add_argparse_args'" error with the lastest version of lightning==2.0.0rc1 (Release on Mar 2, 2023), but I tried with lightning==1.9.0 which is the same as https://github.com/hpcaitech/ColossalAI/blob/main/examples/images/diffusion/requirements.txt, the above bug disappeared.

Camille7777 avatar Mar 09 '23 08:03 Camille7777

Hi, same issue here, using stable version of pytorch lighnining=2.0, just installed from conda

allanchan339 avatar Mar 22 '23 10:03 allanchan339

I have same issue. my version is 2.0.0

seungyeon-seo avatar Mar 30 '23 14:03 seungyeon-seo

Same issue, version is 2.02

beingPurple avatar Apr 30 '23 20:04 beingPurple

https://github.com/Lightning-AI/lightning/pull/16708

EvergreenTree avatar May 03 '23 12:05 EvergreenTree

Same issue! version is 2.0.3

Owen718 avatar Jun 28 '23 10:06 Owen718

I installed pip install pytorch-lightning==1.06 and it WORKED!!

mevanekanayake avatar Aug 03 '23 02:08 mevanekanayake

same issue

Kalyanspunk avatar Aug 08 '23 16:08 Kalyanspunk

same issue wiht pl 2.0.8:

AttributeError: type object 'Trainer' has no attribute 'from_argparse_args'

GKeppler avatar Sep 05 '23 14:09 GKeppler

Same error on pl_version:

'2.0.2'

LightingMc avatar Sep 06 '23 18:09 LightingMc

Same here. Pl 2.2.1

Alvov1 avatar Apr 03 '24 14:04 Alvov1

I found this problem solved with pytorch_lightning==1.6.3

HuangJiameng avatar May 10 '24 13:05 HuangJiameng

same error with the pytorch_lightining == 2.2.4

oscar066 avatar May 19 '24 09:05 oscar066

same with 2.1.0

MasterHow avatar May 20 '24 11:05 MasterHow

Same issue 2.3.3

soumickmj avatar Jul 13 '24 08:07 soumickmj