Open tianlan6767 opened 3 days ago
train.py
# Import the required modules import sys from anomalib.data import AnomalibDataModule from anomalib.engine import Engine from anomalib.models import AnomalyModule import torch # Initialize engine torch.set_float32_matmul_precision('medium') config_path = "./efficientad_all_config.yaml" engine, model, datamodule = Engine.from_config(config_path=config_path) # Train the model engine.train(datamodule=datamodule, model=model)
Folder
Other (please specify in the field below)
OS information:
How to train code quickly
run the code
waiting training
pip
1.2.0.dev0
seed_everything: true trainer: accelerator: auto strategy: auto devices: auto num_nodes: 1 precision: 32 logger: null callbacks: null fast_dev_run: false max_epochs: 1000 min_epochs: null max_steps: 70000 min_steps: null max_time: null limit_train_batches: null limit_val_batches: null limit_test_batches: null limit_predict_batches: null overfit_batches: 0.0 val_check_interval: null check_val_every_n_epoch: 1 num_sanity_val_steps: 0 log_every_n_steps: null enable_checkpointing: True enable_progress_bar: True enable_model_summary: True accumulate_grad_batches: 1 gradient_clip_val: null gradient_clip_algorithm: null deterministic: null benchmark: null inference_mode: true use_distributed_sampler: true profiler: null detect_anomaly: false barebones: false plugins: null sync_batchnorm: false reload_dataloaders_every_n_epochs: 0 normalization: normalization_method: MIN_MAX task: SEGMENTATION metrics: image: - BinaryF1Score - AUROC pixel: - AUROC - BinaryF1Score threshold: class_path: anomalib.metrics.F1AdaptiveThreshold init_args: default_value: 0.5 thresholds: null ignore_index: null validate_args: true compute_on_cpu: false dist_sync_on_step: false sync_on_compute: true default_root_dir: ./ct_splice_8p/run/anomalib ckpt_path: null model: class_path: anomalib.models.EfficientAd init_args: imagenet_dir: datasets/imagenette teacher_out_channels: 384 model_size: S lr: 0.0001 weight_decay: 1.0e-05 padding: false pad_maps: true data: class_path: anomalib.data.Folder init_args: name: splice_16p normal_dir: train/good root: ./datasets/ct_splice_8p # abnormal_dir: test/broken_large # normal_test_dir: null # mask_dir: ground_truth/broken_large normal_split_ratio: 0.0 extensions: - .jpg train_batch_size: 1 eval_batch_size: 1 num_workers: 1 image_size: - 512 - 512 train_transform: class_path: torchvision.transforms.v2.Compose init_args: transforms: - class_path: torchvision.transforms.v2.ToImage - class_path: torchvision.transforms.v2.Resize init_args: size: [512, 512] antialias: True - class_path: torchvision.transforms.v2.ToDtype init_args: dtype: torch.float32 scale: True eval_transform: class_path: torchvision.transforms.v2.Compose init_args: transforms: - class_path: torchvision.transforms.v2.ToImage - class_path: torchvision.transforms.v2.Resize init_args: size: [512, 512] antialias: True - class_path: torchvision.transforms.v2.ToDtype init_args: dtype: torch.float32 scale: True test_split_mode: synthetic # from_dir NONE synthetic test_split_ratio: 0.2 val_split_mode: same_as_test val_split_ratio: 0.2 seed: null
null
Describe the bug
Why is training slow to start ? when i run the training code, it needs at least 6 minutes to train, how i can fix it ?
train.py
Dataset
Folder
Model
Other (please specify in the field below)
Steps to reproduce the behavior
OS information
OS information:
Expected behavior
How to train code quickly
Screenshots
run the code![image](https://github.com/openvinotoolkit/anomalib/assets/71381036/c8dbab3b-6efb-4d44-a4b0-6806c10a6a05)
waiting
training
![image](https://github.com/openvinotoolkit/anomalib/assets/71381036/d7e6f800-d7af-4182-a7ac-9467e1d71197)
Pip/GitHub
pip
What version/branch did you use?
1.2.0.dev0
Configuration YAML
Logs
Code of Conduct