Closed JunMa11 closed 5 years ago
Hi @JunMa11,
the UNetExperiment
is derived from PytorchExperiment
, a class from the TRIXI framework. If you call the exp.run(), you start "the lifecycle" of the Experiment, if you will.
taken from the class documentation of PytorchExperiment:
The basic life cycle of a PytorchExperiment is the same as :class:.Experiment::
setup()
prepare()
for epoch in n_epochs:
train()
validate()
end()
Check the abstract Experiment class of TRIXI for the implementation of run() and run_test(). I like to call the training and testing like this:
c = get_config()
exp = UNetExperiment(config=c, name=c.name, n_epochs=c.n_epochs,
seed=42, append_rnd_to_name=c.append_rnd_string, globs=globals(),
loggers={
"visdom": ("visdom", {"auto_start": c.start_visdom}),
}
)
exp.run()
exp.run_test(setup=False)
You can use the "setup" parameter if you want to call your testing without training first. Make sure you load a pre-trained network in your setup to do this.
Pura vida, André
Hi @elpequeno , Thanks for your help very much.
- Can you be more specific? Does the training augmentation work? During training process, it seems that data augmentation is not executed, because I do not find anywhere the
data_augmentation.py
is called.
data_augmentation.py contains the method get_transforms() which is used in NumpydataLoader (datasets/two_dim/NumpyDataLoader.py). Transforms are applied during data loading.
Got it. Thanks for your guidance.
Hi @elpequeno , In
run_train_pipeline.py
,1) What do
exp.run()
andexp.run_test(setup=False)
mean?exp
is an instance of classUNetExperiment
, but I do not find the definition of the member functionsrun()
andrun_test()
inUNetExperiment
.2) I write a
test()
function inUNetExperiment.py
,When the training is finished, how can I call this function to make inference on test data?
3) I find
data_augmentation.py
indatasets
folder, but the augmentation process is not added to training process.These questions are not urgent. I'm looking forward to your reply after your vacation.