We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've written the code from the link
import numpy as np class CocoDNN(L.LightningModule): def __init__(self): super().__init__() self.model = models.detection.fasterrcnn_mobilenet_v3_large_fpn(weights="DEFAULT") def forward(self, images, targets=None): return self.model(images, targets) def training_step(self, batch, batch_idx): imgs, annot = batch #print(f"Batch :{batch_idx}") batch_losses = [] for img_b, annot_b in zip(imgs, annot): #print(len(img_b), len(annot_b)) if len(img_b) == 0: continue loss_dict = self.model(img_b, annot_b) losses = sum(loss for loss in loss_dict.values()) #print(losses) batch_losses.append(losses) batch_mean = torch.mean(torch.stack(batch_losses)) #print(batch_mean) self.log('train_loss', batch_mean) #print(imgs[0]) #print(' ----',annot) #loss_dict = self.model(img_b, annot_b) #losses = sum(loss for loss in loss_dict.values()) #self.log('train_loss', losses) return batch_mean def configure_optimizers(self): return optim.SGD(self.parameters(), lr=0.001, momentum=0.9, weight_decay=0.0005)
I want to evaluate it using evaluation_step and testing_step. Can you guide me the code refactor do that
evaluation_step
testing_step
Images are 512x512 and coco format.
No response
cc @justusschock @awaelchli
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Outline & Motivation
I've written the code from the link
I want to evaluate it using
evaluation_step
andtesting_step
. Can you guide me the code refactor do thatImages are 512x512 and coco format.
Pitch
No response
Additional context
No response
cc @justusschock @awaelchli
The text was updated successfully, but these errors were encountered: