Skip to content
Snippets Groups Projects
Commit db77dec2 authored by Leonard Wayne Hackel's avatar Leonard Wayne Hackel
Browse files

removing flop count that does not work

parent 658ce297
No related branches found
No related tags found
No related merge requests found
......@@ -49,15 +49,6 @@ class LitVisionEncoder(pl.LightningModule):
self.config = config
self.model = ConfigILM.ConfigILM(config)
def get_stats(self):
# create example image
dummy_input = [torch.rand([1, self.config.channels, self.config.image_size,
self.config.image_size], device=self.device),
torch.ones([1, 32], device=self.device, dtype=torch.int)]
params = parameter_count(self)
flops = FlopCountAnalysis(self, dummy_input)
return {"flops": flops.total(), "params": params['']}
def _disassemble_batch(self, batch):
images, questions, labels = batch
# transposing tensor, needed for Huggingface-Dataloader combination
......@@ -341,9 +332,6 @@ def main(
model = LitVisionEncoder(config=model_config, lr=lr)
model = overwrite_vision_weights(model, vision_checkpoint)
print(f"Model Stats: Params: {model.get_stats()['params']:15,d}\n"
f" Flops: {model.get_stats()['flops']:15,d}")
hf_tokenizer, _ = get_huggingface_model(
model_name=text_model, load_pretrained_if_available=False
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment