Dev (#98)
* remove conda_env_cpu * remove setup.py * optimize tab completion by nesting imports * add .env * fix rich printing bug * general improvements * update readme
This commit is contained in:
1 parent
5f1c85e9bf
commit
d571a4e2c2
22 files changed
+253
-221
No files matched your search
@@ -11,10 +11,15 @@ def predict():
|
||||
"""
|
||||
|
||||
# ckpt can be also a URL!
|
||||
CKPT_PATH = "epoch=0.ckpt"
|
||||
CKPT_PATH = "last.ckpt"
|
||||
|
||||
# load model from checkpoint
|
||||
# model __init__ parameters will be loaded from ckpt automatically
|
||||
# you can also pass some parameter explicitly to override it
|
||||
trained_model = LitModelMNIST.load_from_checkpoint(checkpoint_path=CKPT_PATH)
|
||||
|
||||
# print model hyperparameters
|
||||
print(trained_model.hparams)
|
||||
|
||||
# switch to evaluation mode
|
||||
trained_model.eval()
|
||||
|
||||
@@ -89,7 +89,9 @@ def print_config(
|
||||
|
||||
# TODO print main config path and experiment config path
|
||||
# print(f"Main config path: [link file://{directory}]{directory}")
|
||||
|
||||
|
||||
# TODO refactor the whole method
|
||||
|
||||
style = "dim"
|
||||
|
||||
tree = Tree(f":gear: CONFIG", style=style, guide_style=style)
|
||||
@@ -111,7 +113,10 @@ def print_config(
|
||||
cfg_str = OmegaConf.to_yaml(nested_config_section, resolve=resolve)
|
||||
nested_branch.add(Syntax(cfg_str, "yaml"))
|
||||
else:
|
||||
cfg_str = OmegaConf.to_yaml(config_section, resolve=resolve)
|
||||
if isinstance(config_section, DictConfig):
|
||||
cfg_str = OmegaConf.to_yaml(config_section, resolve=resolve)
|
||||
else:
|
||||
cfg_str = str(config_section)
|
||||
branch.add(Syntax(cfg_str, "yaml"))
|
||||
|
||||
print(tree)
|
||||
|
||||
Reference in new issue
Block a user