bugbug icon indicating copy to clipboard operation
bugbug copied to clipboard

AttributeError: 'XGBClassifier' object has no attribute 'named_steps'

Open suhaibmujahid opened this issue 1 year ago • 9 comments

Turns out that there is an issue; I tried to use the model to classify a certain bug but it didn't work. However, it seems like that there are some steps that may help in the Discussion so I will try those out first. Thanks!

Edited: Sorry, the steps in the Discussion didn't resolve this issue.

(base) naoyaokamoto@Naoyas-MacBook-Air-393 bugbug % python3 -m scripts.bug_classifier stepstoreproduce --bug-id 1635837                                        
2023-12-03 18:38:17,677:INFO:numexpr.utils:NumExpr defaulting to 8 threads.
2023-12-03 18:38:19,688:INFO:__main__:stepstoreproducemodel does not exist. Downloading the model....
2023-12-03 18:38:19,703:INFO:bugbug.utils:Downloading https://community-tc.services.mozilla.com/api/index/v1/task/project.bugbug.train_stepstoreproduce.latest/artifacts/public/stepstoreproducemodel.tar.zst...
tar: Error inclusion pattern: Failed to open 'zstdmt'
2023-12-03 18:38:21,680:WARNING:bugbug.utils:Command '['tar', '-I', 'zstdmt', '-xf', 'stepstoreproducemodel.tar.zst']' returned non-zero exit status 1.. Falling back to zstandard API, which could be slower.
Traceback (most recent call last):
  File "/Users/naoyaokamoto/mambaforge/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/naoyaokamoto/mambaforge/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/naoyaokamoto/Documents/GitHub/bugbug/scripts/bug_classifier.py", line 80, in <module>
    main()
  File "/Users/naoyaokamoto/Documents/GitHub/bugbug/scripts/bug_classifier.py", line 76, in main
    classify_bugs(args.model, args.bug_id)
  File "/Users/naoyaokamoto/Documents/GitHub/bugbug/scripts/bug_classifier.py", line 32, in classify_bugs
    model = model_class.load(model_file_name)
  File "/Users/naoyaokamoto/Documents/GitHub/bugbug/bugbug/model.py", line 593, in load
    model.clf.named_steps["estimator"].load_model(xgboost_model_path)
AttributeError: 'XGBClassifier' object has no attribute 'named_steps'

Originally posted by @naoya2000 in https://github.com/mozilla/bugbug/issues/792#issuecomment-1837426163

suhaibmujahid avatar Dec 03 '23 17:12 suhaibmujahid

@marco-c releasing a new version to retrain the models should fix this issue.

suhaibmujahid avatar Dec 03 '23 17:12 suhaibmujahid

Will do after #3883 is merged!

marco-c avatar Dec 03 '23 22:12 marco-c

Release triggered: 6b0a6d37a8a61320b7abae7da21f6dca124d8ac2.

marco-c avatar Dec 05 '23 17:12 marco-c

New release triggered: d220467520ba7416425e94e530f4f774832967e5.

We now just need to trigger a new training pipeline run, I'll do it after making a new release after landing #3882.

marco-c avatar Dec 06 '23 10:12 marco-c

New release triggered with the fix to #3906: 6372518a2ae5a6207c1228835d0451f92cf6de60.

marco-c avatar Dec 08 '23 13:12 marco-c

Here's the latest pipeline run: https://community-tc.services.mozilla.com/tasks/groups/PhhadDbyTyKw5G1WYMRLhw.

marco-c avatar Dec 08 '23 20:12 marco-c

New release triggered with the fix to #3909: 48a4abacc49a6ff29585b3234823f170de709907.

marco-c avatar Dec 12 '23 15:12 marco-c

Here's the latest pipeline run: https://community-tc.services.mozilla.com/tasks/groups/egftMzaCTf-M1RwzQ9cdRQ.

marco-c avatar Dec 12 '23 15:12 marco-c