Select to view content in your preferred language

arcgis.learn.prepare_data() error calling dataset_type='RCNN_MASKS'

3298
10
11-27-2019 05:44 AM
by Anonymous User
Not applicable

Hi, 

I'm getting an error when calling the prepare_data function in arcgis.learn. The error seems to originate from the data.py file inside the arcgis.learn site-package, inside the dataset_type == 'RCNN_Masks' statement. The error says that the variable 'right' is not yet assigned (which is true because it seems it is only defined inside another dataset_type statement).

API version: 1.7.0

ArcGIS Pro 2.5

10 Replies
by Anonymous User
Not applicable

The prepare_data function will automatically detect the 'dataset_type', try to remove the 'dataset_type' parameter from the function call.

0 Kudos
by Anonymous User
Not applicable

That doesn't work, I'll get the same error as what is asked here: https://community.esri.com/message/894425-re-deep-learning-preparedata?commentID=894425&et=watches.e.... The dataset_type parameter actually helped me further already then trying to do without. 

The problem seems to be in the _data.py script, I see a couple of mistakes there. And it also appears to be there in multiple arcgis api versions..

The tutorial to follow you proposed in the other comment about extracting building footprints, I actually tried to follow, but since there is nothing really specified about error handling, it doesn't help me any further. The same errors appear, no matter if I use a Classification tiles dataset (with or without specifying the dataset_type Classification_Tiles as well), or if I use the RCNN_Masks.

Do you know which version of the arcgis api was used to make the tutorial? Cause it probably has worked in that specific version..

0 Kudos
by Anonymous User
Not applicable

Can you put a screenshot of the error which you get when you do not specify the dataset_type, we get the error message 'Could not infer dataset type.' when we supply a wrong folder or the emd file is missing.

0 Kudos
by Anonymous User
Not applicable

Here's the error message. It indeed says 'could not infer dataset type', however the folder is correct AND the emd files is inside that folder (this accounts for both classified tiles and rcnn masks datasets). 

Message for using Classified Tiles dataset:

Folder for the classified tiles, including the emd file as well:

Dependencies in my geoai env:

Exactly the same happens when I use a RCNN mask dataset.

0 Kudos
by Anonymous User
Not applicable

A classified tiles data looks like this 

which version of ArcGIS Pro are you using ?

Also can you try moving the training data to a shorter path such as C:\myfolder and supply the path parameter directly ?

If this does not work please share the esri_model_definition.emd file, so that i can have a look into it. 

0 Kudos
by Anonymous User
Not applicable

Well the 'models' folder doesn't seem to be created in my case. What is inside that folder and is it essential for the prepare data to work? I created the dataset using the 'Export training data for deep learning' tool in ArcGIS Pro 2.3.0. It completed creating the dataset(s) without any warnings or errors.

However, in my GeoAI env, arcgis api v.1.7.0 and arcgis pro v.2.4 are installed. 

I'll try using a shorter path and let you know if that works. If not, I'll share the .emd file.

0 Kudos
by Anonymous User
Not applicable

No the models folder is created once you start training, it is not required for prepare_data.

Get Outlook for Android<https://aka.ms/ghei36>

0 Kudos
by Anonymous User
Not applicable

Okay, good to know. Then the folder content seems to be similar.

I tried moving the dataset to a shorter path, but that doesn't seem to do the trick. 

Here's my .emd file:

0 Kudos
by Anonymous User
Not applicable

Your EMD format is not proper for RCNN masks and the latest Python API for ArcGIS. Which version of ArcGIS Pro are you using ?

0 Kudos