Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'ray.train._internal.session' has no attribute '_get_session'. Did you mean: 'get_session'? #50049

Open
Petros626 opened this issue Jan 24, 2025 · 0 comments

Comments

@Petros626
Copy link

Hello,

I'm using ultralytics and try to train my model with 'wandb' sweep, I wonder about a message of ray when trying to find hyperparameters with wandb. When the trainer valides the model the following errors occurs:

Run 5v25s5xh errored:
Traceback (most recent call last):
  File "/home/heizung1/anaconda3/envs/ultralytics/lib/python3.12/site-packages/wandb/agents/pyagent.py", line 306, in _run_job
    self._function()
  File "/tmp/ipykernel_1296223/818960771.py", line 111, in train
    results = model.train(data='/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/cfg/datasets/kitti_bev.yaml', epochs=wandb.config.epochs,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/model.py", line 809, in train
    self.trainer.train()
  File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/trainer.py", line 207, in train
    self._do_train(world_size)
  File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/trainer.py", line 460, in _do_train
    self.run_callbacks("on_fit_epoch_end")
  File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/trainer.py", line 168, in run_callbacks
    callback(self)
  File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/utils/callbacks/raytune.py", line 17, in on_fit_epoch_end
    if ray.train._internal.session._get_session():  # replacement for deprecated ray.tune.is_session_enabled()
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'ray.train._internal.session' has no attribute '_get_session'. Did you mean: 'get_session'?

�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m Run 5v25s5xh errored:
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m Traceback (most recent call last):
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m   File "/home/heizung1/anaconda3/envs/ultralytics/lib/python3.12/site-packages/wandb/agents/pyagent.py", line 306, in _run_job
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m     self._function()
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m   File "/tmp/ipykernel_1296223/818960771.py", line 111, in train
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m     results = model.train(data='/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/cfg/datasets/kitti_bev.yaml', epochs=wandb.config.epochs,
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m   File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/model.py", line 809, in train
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m     self.trainer.train()
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m   File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/trainer.py", line 207, in train
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m     self._do_train(world_size)
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m   File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/trainer.py", line 460, in _do_train
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m     self.run_callbacks("on_fit_epoch_end")
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m   File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/engine/trainer.py", line 168, in run_callbacks
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m     callback(self)
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m   File "/home/heizung1/ultralytics_yolov8-obb_ob_kitti/ultralytics/utils/callbacks/raytune.py", line 17, in on_fit_epoch_end
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m     if ray.train._internal.session._get_session():  # replacement for deprecated ray.tune.is_session_enabled()
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m AttributeError: module 'ray.train._internal.session' has no attribute '_get_session'. Did you mean: 'get_session'?
�[34m�[1mwandb�[0m: �[32m�[41mERROR�[0m

Please help to solve this, because I can't start training.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant