aimhubio / aim

Aim 💫 — An easy-to-use & supercharged open-source experiment tracker.
https://aimstack.io
Apache License 2.0
4.93k stars 297 forks source link

Add more information (metrics, images) to an experiment (AimCallback is used there) #3128

Open andife opened 3 months ago

andife commented 3 months ago

❓Question

Hi,

I'm using the AimCallback (aim.keras import) for my training within tensorflow.

Now I wanta directly integrate some result so the same run. For example some metrics and images? How can I combine an existing callback with additional infos?

Thank you

mihran113 commented 3 months ago

Hey @andife! The instance of AimCallback class has a property named experiment, which is the underlying aim.Run object. So to track additional metrics and images, you'll need to do something like this:

from aim.keras import AimCallback
from aim import Image as AimImage

aim_callback = AimCallback()
...
aim_callback.experiment.track(0, 'test_metric')
aim_callback.experiment.track(AimImage(some_input), 'test_image_sequence')

You can find additional details about how to track images in the documentation, if there'll be any questions. https://aimstack.readthedocs.io/en/latest/quick_start/supported_types.html#image-tracking-with-aim