aim icon indicating copy to clipboard operation
aim copied to clipboard

Add fast.ai integration

Open Khazhak opened this issue 4 years ago • 8 comments

Closes #462.

Khazhak avatar May 06 '21 03:05 Khazhak

Let's add training code example for fast.ai as well, inside examples directory.

gorarakelyan avatar May 06 '21 08:05 gorarakelyan

@Khazhak I get this error when running fastai_track.py

 Traceback (most recent call last):
  File "fastai_track.py", line 31, in <module>
    dls = arab_mnist.dataloaders('.')
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastai/data/block.py", line 113, in dataloaders
    dsets = self.datasets(source, verbose=verbose)
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastai/data/block.py", line 110, in datasets
    return Datasets(items, tfms=self._combine_type_tfms(), splits=splits, dl_type=self.dl_type, n_inp=self.n_inp, verbose=verbose)
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastai/data/core.py", line 329, in __init__
    self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastai/data/core.py", line 329, in <listcomp>
    self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastcore/foundation.py", line 97, in __call__
    return super().__call__(x, *args, **kwargs)
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastai/data/core.py", line 255, in __init__
    self.setup(train_setup=train_setup)
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastai/data/core.py", line 273, in setup
    x = super().__getitem__(0) if self.splits is None else super().__getitem__(self.splits[0])[0]
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastcore/foundation.py", line 111, in __getitem__
    def __getitem__(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)
  File "/Users/gor/Projects/aim/test-envs/fastai/venv/lib/python3.6/site-packages/fastcore/foundation.py", line 115, in _get
    if is_indexer(i) or isinstance(i,slice): return getattr(self.items,'iloc',self.items)[i]
IndexError: list index out of range

gorarakelyan avatar May 11 '21 07:05 gorarakelyan

Taking a look.

Khazhak avatar May 11 '21 08:05 Khazhak

Python 3.6.5

fastai==2.3.1 torch==1.8.1 torchtext==0.6.0 torchvision==0.9.1

gorarakelyan avatar May 13 '21 13:05 gorarakelyan

@Khazhak Let's format trainer configs with _format_config function and pass to the aim session

# Cell
def _format_config_value(v):
    if isinstance(v, list):
        return [_format_config_value(item) for item in v]
    elif hasattr(v, '__stored_args__'):
        return {**_format_config(v.__stored_args__), '_name': v}
    return v

# Cell
def _format_config(config):
    "Format config parameters before logging them"
    for k,v in config.items():
        if isinstance(v, dict):
            config[k] = _format_config(v)
        else:
            config[k] = _format_config_value(v)
    return config

gorarakelyan avatar May 19 '21 12:05 gorarakelyan

@gorarakelyan Could you please assign me this issue if no one else is working on it?

karan2801 avatar Jun 02 '22 16:06 karan2801

@karan2801 done ✅

gorarakelyan avatar Jun 03 '22 12:06 gorarakelyan

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

:x: Ubuntu
:x: Khazhak


Ubuntu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 16 '22 19:07 CLAassistant

closing this PR. The further development moved here #2123

gorarakelyan avatar Sep 05 '22 13:09 gorarakelyan