Closed smilesun closed 4 years ago
@smilesun sorry for the confusion. Here is the documentation to the latest pip release. tune.report
is not available there yet (and instead should be tune.track.log
) - https://docs.ray.io/en/latest/tune.html
If you want to install from master, use the latest nightly wheels: https://docs.ray.io/en/master/installation.html#latest-snapshots-nightlies
tune.report
is going to replace tune.track.log
in future versions of Ray.
thanks!
Hi @smilesun ,
Please note that some of your examples also need to be updated after this API change from report
to track.log
(maybe they could be even incorporated / converted to unit tests?):
https://github.com/ray-project/ray/search?q=tune.report&type=Code
I'd reopen the issue to prevent this getting forgotten:)
For clarity - tune.track.log
is being changed to tune.report
in 0.8.6.
This should be addressed in the future by #9427
Am using kaggle to train my model , Ray -- Version: 2.6.3 Ultralytics --version 8.2.6
Error: AttributeError Traceback (most recent call last) Cell In[3], line 9 6 model = YOLO("yolov5s.yaml") 8 # Train the model ----> 9 metrics = model.train(data='/kaggle/input/newcreare/data.yaml', epochs=30, verbose=True) 12 # Save the trained model 13 model.save("yolov5_ans.pt")
File /opt/conda/lib/python3.10/site-packages/ultralytics/engine/model.py:673, in Model.train(self, trainer, **kwargs) 670 pass 672 self.trainer.hub_session = self.session # attach optional HUB session --> 673 self.trainer.train() 674 # Update model and cfg after training 675 if RANK in {-1, 0}:
File /opt/conda/lib/python3.10/site-packages/ultralytics/engine/trainer.py:199, in BaseTrainer.train(self) 196 ddp_cleanup(self, str(file)) 198 else: --> 199 self._do_train(world_size)
File /opt/conda/lib/python3.10/site-packages/ultralytics/engine/trainer.py:440, in BaseTrainer._do_train(self, world_size) 438 self.scheduler.last_epoch = self.epoch # do not move 439 self.stop |= epoch >= self.epochs # stop if exceeded epochs --> 440 self.run_callbacks("on_fit_epoch_end") 441 gc.collect() 442 torch.cuda.empty_cache() # clear GPU memory at end of epoch, may help reduce CUDA out of memory errors
File /opt/conda/lib/python3.10/site-packages/ultralytics/engine/trainer.py:162, in BaseTrainer.run_callbacks(self, event) 160 """Run all existing callbacks associated with a particular event.""" 161 for callback in self.callbacks.get(event, []): --> 162 callback(self)
File /opt/conda/lib/python3.10/site-packages/ultralytics/utils/callbacks/raytune.py:17, in on_fit_epoch_end(trainer) 15 def on_fit_epoch_end(trainer): 16 """Sends training metrics to Ray Tune at end of each epoch.""" ---> 17 if ray.train._internal.session._get_session(): # replacement for deprecated ray.tune.is_session_enabled() 18 metrics = trainer.metrics 19 metrics["epoch"] = trainer.epoch
AttributeError: module 'ray.train._internal.session' has no attribute '_get_session'
^ Same issue.
@Ansilins I've discovered that this was fixed in v8.1.38 of ultralytics. If you can't update because you're using YOLOv10, a temporary hotfix is to go into ultralytics/utils/callbacks/raytune.py
and update a single line of code as was done for v8.1.38 of Ultralytics: https://github.com/ultralytics/ultralytics/commit/1828cfe842eb45b9d4c098fda99d2515835b861b
Thank you @umarbutler
What is your question?
Ray version 0.8.5 pytorch version 1.0.1.post2 OS: Ubuntu 18
I copied the tutorial from https://docs.ray.io/en/master/tune.html#tune-index into an empty python file tune.py then I call python tune.py, I got the following error in the error log file I checked separatedly, ray.tune on my machine indeed does not have a "report" method, anything I did wrong for installation? I just did as the tutorial said
pip install 'ray[tune]'