Train loss #702
Train loss
#702
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can I obtain the train loss for each epoch when training a model?
Here is the training code I've set up.
`from pytorch_lightning.loggers import TensorBoardLogger
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning import Trainer
m = main.deepforest(config_args={"num_classes":4}, label_dict={"Cluster0":0,"Cluster1":1,"Cluster2":2,"Cluster3":3})
deepforest_release_model = main.deepforest()
deepforest_release_model.use_release()
logger = TensorBoardLogger("tb_logs", name="my_model")
Extract single class backbone that will have useful features for multi-class classification
m.model.backbone.load_state_dict(deepforest_release_model.model.backbone.state_dict())
m.model.head.regression_head.load_state_dict(deepforest_release_model.model.head.regression_head.state_dict())
m.config['gpus'] = '-1' #move to GPU and use all the GPU resources
m.config["train"]["csv_file"] = annotations_file
m.config["train"]["root_dir"] = os.path.dirname(annotations_file)
m.config["train"]["epochs"] = 200
m.config["score_thresh"] = 0.4
m.config["validation"]["csv_file"] = validation_file
m.config["validation"]["root_dir"] = os.path.dirname(validation_file)
m.create_trainer(logger=logger)`
Any help is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions