You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In anomalib 1.0.0, I use from_config to get the engine, datamodule, and model.
But I can put logger there.
I tried this but I still cant use logger, can anyone help me on this?
`# Load YAML configuration
from omegaconf import OmegaConf
from lightning.pytorch import Trainer
from anomalib.utils.config import update_config
from anomalib.engine import Engine
from anomalib.loggers import AnomalibTensorBoardLogger
logger = AnomalibTensorBoardLogger(
save_dir="C:/YuXuan/anomaly3/tensorboard_logs", # Use this for root directory
name="default",
log_graph=False,
default_hp_metric=True,
prefix=""
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In anomalib 1.0.0, I use from_config to get the engine, datamodule, and model.
But I can put logger there.
I tried this but I still cant use logger, can anyone help me on this?
`# Load YAML configuration
from omegaconf import OmegaConf
from lightning.pytorch import Trainer
from anomalib.utils.config import update_config
from anomalib.engine import Engine
from anomalib.loggers import AnomalibTensorBoardLogger
Load the YAML configuration
config_path = r"C:\anomaly3\model\patchcore.yaml"
config = OmegaConf.load(config_path)
config = update_config(config)
Initialize the logger and trainer
trainer = Trainer(
logger=config.trainer.logger,
max_epochs=config.trainer.max_epochs,
)
logger = AnomalibTensorBoardLogger(
save_dir="C:/YuXuan/anomaly3/tensorboard_logs", # Use this for root directory
name="default",
log_graph=False,
default_hp_metric=True,
prefix=""
)
Initialize the Engine
engine = Engine(logger=logger)
Load model and datamodule
engine, model, datamodule = engine.from_config(config_path)
Train the model
engine.fit(model, datamodule)`
Beta Was this translation helpful? Give feedback.
All reactions