grok-ai / nn-template Goto Github PK
View Code? Open in Web Editor NEWGeneric template to bootstrap your PyTorch project.
Home Page: https://grok-ai.github.io/nn-template
License: MIT License
Generic template to bootstrap your PyTorch project.
Home Page: https://grok-ai.github.io/nn-template
License: MIT License
Hi @lucmos, this looks like an awesome repo. I stumbled on it while doing some research on project templates for ML projects. I'm one of the creators of DAGsHub which is a platform built on Git, DVC, and MLflow. It integrates with GitHub and provides a free DVC remote and MLflow server so that you can track experiments and share your data & models in one UI.
Here's an example project to showcase the abilities:
https://dagshub.com/OperationSavta/SavtaDepth
It seems really in line with what you're creating here, and I would love to hear your thoughts about it.
Hi,
This issue concerns the function from nn_core.serialization import load_model
Suppose i train a pytorch model with class MyLightningModule, and that I saved the checkpoint in model_path.
Suppose now that the class MyLightningModule has received some minor changes, like a new class variable has been added.
Let's call this version MyLightningModuleV2.
When I load a model using this function, like:
self.model = load_model(module_class=MyLightningModuleOld, checkpoint_path=Path(model_path), map_location=self.device).to(self.device).eval()
I get an error because the chekpoint refers to the model of class MyLightningModule and therefore the new variable is (obviously) missing.
To make it work, i need to load the model with the old version of the class, that is, MyLightningModule, and then manually setting "model.new_variable" to the value i want to get, like the following:
self.model = load_model(module_class=MyLightningModuleOld, checkpoint_path=Path(model_path), map_location=self.device).to(self.device).eval()
self.model.new_variable = False
It would be nice to have this option in the load_model function to avoid creating multiple versions of the same class.
See for example https://github.com/txie-93/cdvae and txie-93/cdvae#17, though I haven't tried directly with nn-template
.
Thank you very much for this template, how can we restore the weights of a specific run using wandb? thanks
Hey Valentino & Luca,
I am just catching up with some bookmarks and remembered your repo here :). As someone who constantly fuzzes about the ideal project structure, that's actually pretty cool. I have been using an adapted version of the data science cookiecutter for generic ML projects, but nothing sophisticated like this here with code stubs.
Haven't thoroughly played with it yet, though, besides creating an example folder and looking at the pl_module.py
and datamodule.py
files, which look good to me!
In any case, long story short, I was wondering if you'd be interested in the PyTorch Lightning's ecosystem CI to make sure that it stays fresh and relevant wrt to upcoming version releases (comes with free CPU and multi-GPU CI tests): https://devblog.pytorchlightning.ai/stay-ahead-of-breaking-changes-with-the-new-lightning-ecosystem-ci-b7e1cf78a6c7
If you are interested in that, I am sure my colleague @Borda would be happy to assist with questions & technical details -- he built this thing, so he probably knows best :)
Hi, it is an awesome template!
For me it looked like you have similar principles as in Lightning-Hydra-Template. I am wondering if you collaborate?
The template is really awesome.
I had a small issue. When I run the Streamlit UI without being logged in in Weights and Biases. The UI just hanged with the loading status without giving me any feedback about what was happening, so that I have to log in first in wandb.
I had to login manually from the console. Is there any way to solve this issue? For example to have feedback from the UI if I'm not logged in.
Thanks!
We should change all the imports from pytorch_lightning
to lightning
However, naively substituting all the occurrences does not work -- unknown reasons atm.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.