Using nbdev + fastai2 on an existing project

I am thinking of porting an existing pytorch based project to fastai2 and nbdev, but I am a not convinced about how to do so. My initial idea was to

  1. Create a new nbdev based project
  2. Add fastai2 as a github submodule, so that it can be imported with
  3. add the old repo as a submodule so that I can import and gradually migrate to notebooks

Proceed.

It feels quite clunky though. Are there better ways?

3 Likes

Sure! There’s nothing really to do - just pip install both. For fastai2, an editable install would be best, since it’s changing fast.

You can turn your existing repo into an nbdev repo by just copying over the stuff from nbdev_template, and editing settings.ini. Then you can pick some small module and turn it into a notebook, export it, and make sure the rest of your project still works OK.

11 Likes

I knew it could not be that hard. Thanks!

1 Like

What stuff do we need to copy?