In the doc Computer Vision — Ray 2.6.3 where a CV sample is given to show how the AIR works for CV . Here is a code snippet,
dataset = per_epoch_preprocessor.transform(dataset)
trainer = TorchTrainer(
train_loop_per_worker=train_loop_per_worker,
train_loop_config={“batch_size”: 32, “lr”: 0.02, “epochs”: 1},
datasets={“train”: dataset},
scaling_config=ScalingConfig(num_workers=2),
preprocessor=preprocessor,
)
results = trainer.fit()
The two preprocessors seem put wrong places and the right should look like this:
dataset = preprocessor.transform(dataset)
trainer = TorchTrainer(
train_loop_per_worker=train_loop_per_worker,
train_loop_config={“batch_size”: 32, “lr”: 0.02, “epochs”: 1},
datasets={“train”: dataset},
scaling_config=ScalingConfig(num_workers=2),
preprocessor=per_epoch_preprocessor,
)
results = trainer.fit()
Let me know if I think it right and pls be free to correct me if I am wrong.