Skip to content
New issue

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

[Not to be merged] Changes for profiling. #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wandb/
*.sh
*.txt

5 changes: 5 additions & 0 deletions net_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning import loggers
from pytorch_lightning.profiler import SimpleProfiler


from simnet.lib.net import common
from simnet.lib import datapoint
Expand Down Expand Up @@ -69,6 +71,8 @@ def draw_detections(
model = PanopticModel(hparams, epochs, train_ds, EvalMethod())
model_checkpoint = ModelCheckpoint(filepath=hparams.output, save_top_k=-1, period=1, mode='max')
wandb_logger = loggers.WandbLogger(name=hparams.wandb_name, project='CenterSnap')

profiler = SimpleProfiler()

if hparams.finetune_real:
trainer = pl.Trainer(
Expand All @@ -94,6 +98,7 @@ def draw_detections(
default_save_path=hparams.output,
use_amp=False,
print_nan_grads=True,
profiler=profiler
)

trainer.fit(model)
2 changes: 1 addition & 1 deletion simnet/lib/net/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, dataset_uri, hparams, preprocess_image_func=None, datapoint_d
super().__init__()
if datapoint_dataset is None:
datapoint_dataset = datapoint.make_dataset(dataset_uri)
self.datapoint_handles = datapoint_dataset.list()
self.datapoint_handles = datapoint_dataset.list()[:200]
# No need to shuffle, already shufled based on random uids
self.hparams = hparams
if preprocess_image_func is None:
Expand Down