How to save data into a folder after using arcgis.learn.prepare_data

776
1
Jump to solution
08-02-2021 07:32 PM
lienpham83
New Contributor III

After running 'Export training data for deep learning' tool in Arcgis Pro, named as 'training_folder', I did data augmentation on the 'training_folder' using arcgis.learn.prepare_data. Then,I would like to save the result of data augmentation into a folder. However, it has error Below are my code in Python Arcgis Pro:

  import arcpy, arcgis
  from arcpy.ia import *
  arcpy.CheckOutExtension("ImageAnalyst")
  data=arcgis.learn.prepare_data(r'C:\training_folder')
  data.save(r'C:\Data\Deep_Learning\test')

When I run this script, it has error as below:

   Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\fastai\basic_data.py", line 155, in save
try_save(self.label_list, self.path, file)
    File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\fastai\torch_core.py", line 411, in try_save
target = open(path/file, 'wb') if is_pathlike(file) else file
PermissionError: [Errno 13] Permission denied: 'C:\\Data\\Deep_Learning\\test'

Could you please help me how to save the result of data augmentation into a folder?

Thank you for your help.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

@lienpham83 we do not support this method as of now, it is inherited from fastai which is the underlying technology driving this datatype. It does not save augmented files on chip but just a reference of data object. In order to train models with augmented dataset you need not do this step. You can directly use this data object and pass in to the target model. 
For example 

model = arcgis.learn.UnetClassifier(data)

Thanks,
Sandeep 

View solution in original post

0 Kudos
1 Reply
by Anonymous User
Not applicable

@lienpham83 we do not support this method as of now, it is inherited from fastai which is the underlying technology driving this datatype. It does not save augmented files on chip but just a reference of data object. In order to train models with augmented dataset you need not do this step. You can directly use this data object and pass in to the target model. 
For example 

model = arcgis.learn.UnetClassifier(data)

Thanks,
Sandeep 

0 Kudos