How to do data augmentation for deep learning model

3885
11
Jump to solution
04-15-2021 07:47 PM
lienpham83
New Contributor III

Hi,

I got training data for my deep learning model by using export training data for deep learning tool in Arcgis Pro. I would like to do data augmentation on this training data. So, my code is 

data=arcgis.learn.prepare_data(r'G:\data_training',
class_mapping={0: 'tree'}, chip_size=640, val_split_pct=0.1, batch_size=2,transforms=True,resize_to=800).

When I run the code, it has error:

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\_data.py, in prepare_data:
Line 1570:  data = (data.transform(transforms, **kwargs_transforms)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\data_block.py, in transform:
Line 504:   assert is_listy(tfms) and len(tfms) == 2, "Please pass a list of two lists of transforms (train and valid)."

AssertionError: Please pass a list of two lists of transforms (train and valid)

 Could you please suggest how I can fix this error? Thank you for your help

0 Kudos
11 Replies
lienpham83
New Contributor III

Thank you for your great help. I will do and let you know the result.

 

 

0 Kudos
Sreebhadra_H_R
New Contributor

No need of providing a tuple (tfms1,tfms2) for transforms. The get_transforms function itself generates two transformations - One for training and the other for validation respectively. Just pass "transforms=tfms" within prepare_data()

 

0 Kudos