fix most of wandb callbacks
This commit is contained in:
1 parent
66097c4bf3
commit
90174d52c4
9 files changed
+100
-120
No files matched your search
@@ -1,33 +0,0 @@
|
||||
# THIS FILE WILL EXECUTE ALL EXPERIMENT CONFIGS LOCATED IN SPECIFIED FOLDER ONE AFTER THE OTHER
|
||||
|
||||
from argparse import ArgumentParser
|
||||
import train
|
||||
import wandb
|
||||
import yaml
|
||||
import os
|
||||
|
||||
|
||||
def main(project_config_path, run_configs_path):
|
||||
|
||||
with open(project_config_path, "r") as ymlfile:
|
||||
project_config = yaml.load(ymlfile, Loader=yaml.FullLoader)
|
||||
|
||||
with open(run_configs_path, "r") as ymlfile:
|
||||
run_configs = yaml.load(ymlfile, Loader=yaml.FullLoader)
|
||||
|
||||
# EXECUTE ALL RUNS ONE AFTER THE OTHER
|
||||
for conf_name in run_configs:
|
||||
print(f"\nEXECUTING RUN: {conf_name}\n")
|
||||
train.train(project_config=project_config, run_config=run_configs[conf_name], use_wandb=True)
|
||||
wandb.finish()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-p", "--project_config_path", type=str,
|
||||
default=os.path.join(train.BASE_DIR, "config.yaml"))
|
||||
parser.add_argument("-r", "--run_configs_path", type=str,
|
||||
default=os.path.join(train.BASE_DIR, "run_configs.yaml"))
|
||||
args = parser.parse_args()
|
||||
|
||||
main(project_config_path=args.project_config_path, run_configs_path=args.run_configs_path)
|
||||
@@ -0,0 +1 @@
|
||||
import hydra
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
from pytorch_modules.lightning_datamodules.mnist_datamodule import transforms
|
||||
from pytorch_modules.transforms import mnist_transforms
|
||||
from PIL import Image
|
||||
|
||||
# the LitModel you import should be the same as the one you used for training!
|
||||
@@ -29,7 +29,7 @@ def predict():
|
||||
# img = Image.open("data/example_img.png").convert("RGB") # for RGB conversion
|
||||
|
||||
# preprocess
|
||||
img = transforms.mnist_test_transforms(img)
|
||||
img = mnist_transforms.mnist_test_transforms(img)
|
||||
img = img.reshape((1, *img.size())) # reshape to form batch of size 1
|
||||
|
||||
# inference
|
||||
Reference in new issue
Block a user