tracel-ai / burn

Burn is a new comprehensive dynamic Deep Learning Framework built using Rust with extreme flexibility, compute efficiency and portability as its primary goals.
https://burn.dev
Apache License 2.0
8.89k stars 440 forks source link

Getting started with repo template using cargo-generate #282

Open antimora opened 1 year ago

antimora commented 1 year ago

It's often helpful if there is a repo template with all right set up for new comers. We can use a tool such as cargo-generate (see this example project) to generate a pre-defined project.

0xkelvin commented 1 year ago

yo, i would love to help on this one, is it still available ? @antimora

antimora commented 1 year ago

@0xkelvin it would be great if you could work on this. It is perfect timing since we have books and plenty of examples.

@nathanielsimard , @louisfd , @Luni-4 if you have some input on this, please comment.

0xkelvin commented 1 year ago

i am newbie, so if you guys have some guidance please just write down,

nathanielsimard commented 1 year ago

@0xkelvin I'm still unsure if cargo-generate is the right tool for the job. Ultimately we would like to allow workflows such as:

  1. Kind of task (Classification, Regression, etc.)
  2. Kind of model 2.1 With optional pretrained weights
  3. Configure training (optional) 3.1 Chose paradigm (Supervised, Unsupervised, Multi-tasks, etc.) 3.2 Chose datasets to be used (can be custom with todo!) 3.3 Chose metrics with good defaults
  4. Configure deployment (optional) 4.1 WASM, REST API, embedded system, etc.

Those are not the requirements for an early version, nor the full list of features we would like in an helper tool to get started with burn, but serves more as a vision for what could be.

Maybe creating a custom CLI tool using clap may be more flexible and allow for more complexity and options; having online search for pre-trained weights, generating custom Rust code with todo! at the right places, stuff like that.

What are your thoughts @antimora

antimora commented 1 year ago

I think for a minimum we create a template repository to help new users get started. I have feeling users copy MNIST example cargo. Next we could tackle other use cases.

0xkelvin commented 1 year ago

nice, let me find out more, and keep a post here

Luni-4 commented 1 year ago

We can create this CLI using clap to manage the options and minijinja to fill in the templates with the data inserted through CLI. minijinja provides lots of examples in the main repository and this could help quite a lot in the definition of this new tool

BuildBackBuehler commented 6 months ago

This could really use to be done. This was going to be my first dive into Rustdom but it feels too involved to get it up and running. It seems like Rustaceans expect new users to...want to build to play? Or just don't think of 'em. I read everything up to #5 of the Burn Book and it is well written no doubt. But, I jumped to the end because I just want to get to the action, hoping there'd be an "okay dummy who actually needed to read this, now here's how you play" but it leaves one without any idea how to get things running.

I need to convert my Pytorch model and run it, that's about it. But there are no commands ever provided. I get the gist that one doesn't really do much in the CLI, as it states how burn-import should be explicitly separate from burn in order to run the conversion process prior to handing over the model to burn. But I still wasn't provided a single command or exe to run. I figured I'd need to run cargo run burn-import {model path} but who knows.

The example only states cargo run -- 15 for the Pytorch Import Weights example. So where am I running this from? My weights are 400 shards worth of files, what do I run, where do the files need to be if I can't just put the directory in?

Personally, I like to play now, ask questions later. I think most people are that way, desiring some quick reward. I can't find it but someone had the right idea -- new users just want to pick it right up and have it work. That'd be wonderful, I'd learn by doing, running into errors/problems and fixing them. Baby steps. But because you/I/we/wambo are getting results, it doesn't even feel like a problem, you just wanna nip it in the bud and get back to it! That's my 2c, /endrant. I love the project (so thanks for the important part, it -- the substance!) and its wonderfully built up and out, so hopefully I missed something or I'll find another project in the same vain with the steps all spelt out to the t and bring those lessons back here so I can getta crackin'

Oo did find this (thanks to whoever linked it in the examples/pytorch-weights ex., so hopefully this is what I need! https://dev.to/laggui/transitioning-from-pytorch-to-burn-45m)