Installing a dlpk file using arcgis.learn

3330
8
Jump to solution
11-21-2021 05:54 AM
mehdihamdoune
New Contributor II

Hello everybody, 

I'm working on a deep learning project and I needed to use a trained model. But when i want to install it, an error shows up that i don't understand. 

RunTimeError : model should be created from a portal item or a portal url.

Can anyone explain me the error and tell me how to fix it ?

Thanks for your attention and for your help.

0 Kudos
1 Solution

Accepted Solutions
MehdiPira1
Esri Contributor

Hi @mehdihamdoune ,

It should work if you first add the dlpk file to Portal/AGOL from Content > Add Item then get it in your script via item id as follows:

detect_objects_model_package = gis.content.get(item_id)
detect_objects_model = Model(detect_objects_model_package)
detect_objects_model.install(gis=gis)

I hope that helps.

View solution in original post

8 Replies
mehdihamdoune
New Contributor II

Capture.jpg

MehdiPira1
Esri Contributor

Hi @mehdihamdoune ,

It should work if you first add the dlpk file to Portal/AGOL from Content > Add Item then get it in your script via item id as follows:

detect_objects_model_package = gis.content.get(item_id)
detect_objects_model = Model(detect_objects_model_package)
detect_objects_model.install(gis=gis)

I hope that helps.

Mehdi99
New Contributor

Thank you for the response, it works.

0 Kudos
MehdiPira1
Esri Contributor

Glad to hear that @Mehdi99 .

0 Kudos
Mehdi99
New Contributor

Thank you for the response, it works.

0 Kudos
DanPatterson
MVP Esteemed Contributor

is it one of these tools?

Classify Pixels Using Deep Learning (Raster Analysis)—ArcGIS Pro | Documentation

The input model of this tool will only take a deep learning package (.dlpk) item from the portal.


... sort of retired...
0 Kudos
mehdihamdoune
New Contributor II

It isn't this tool, but similar to it. We're classifying 3D pointclouds.

0 Kudos
DanPatterson
MVP Esteemed Contributor

check the tool you are using, they have the restrictions listed in the tool's help topic


... sort of retired...
0 Kudos