Select to view content in your preferred language

Error when trying to train a deep learning model - not sure what the error means

1047
5
09-20-2022 08:56 AM
Labels (2)
Aique
by
New Contributor

I downloaded the deep learning frameworks and installed them

I've got Image Analyst enabled. 

I marked the waterbodies to 'label objects for deep learning'

Next I successfully exported training samples 

When I try to train the model - this is the error message I get ... 

I do not understand what the message means. Does anyone have any experience with this?

Appreciate any and all help and advice resolving the error. 

Thanks for the help! 

________________________________________________________________

Downloading: "https://download.pytorch.org/models/resnet34-333f7ec4.pth" to C:\Users\aqureshi/.cache\torch\hub\checkpoints\resnet34-333f7ec4.pth
Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\urllib\request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\http\client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\http\client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\http\client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\http\client.py", line 1040, in _send_output
self.send(msg)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\http\client.py", line 980, in send
self.connect()
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\http\client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 313, in execute
training_model_object = training_model(data_bunch, **kwargs)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_ssd.py", line 483, in __init__
self.learn = cnn_learner(
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\vision\learner.py", line 100, in cnn_learner
model = create_cnn_model(base_arch, data.c, cut, pretrained, lin_ftrs, ps=ps, custom_head=custom_head,
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\vision\learner.py", line 87, in create_cnn_model
body = create_body(base_arch, pretrained, cut)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\fastai\vision\learner.py", line 59, in create_body
model = arch(pretrained)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\torchvision\models\resnet.py", line 288, in resnet34
return _resnet('resnet34', BasicBlock, [3, 4, 6, 3], pretrained, progress,
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\torchvision\models\resnet.py", line 262, in _resnet
state_dict = load_state_dict_from_url(model_urls[arch],
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\torch\hub.py", line 524, in load_state_dict_from_url
download_url_to_file(url, cached_file, hash_prefix, progress=progress)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\torch\hub.py", line 394, in download_url_to_file
u = urlopen(req)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\urllib\request.py", line 517, in open
response = self._open(req, data)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\urllib\request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\urllib\request.py", line 1389, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\urllib\request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1129)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 390, in <module>
execute()
File "c:\program files\arcgis\pro\Resources\ArcToolbox\Toolboxes\Image Analyst Tools.tbx\TrainDeepLearningModel.tool\tool.script.execute.py", line 385, in execute
del training_model_object
UnboundLocalError: local variable 'training_model_object' referenced before assignment

 

0 Kudos
5 Replies
AkshayaSuresh1
New Contributor

Hey there, are you trying to refine an existing model?

0 Kudos
Aique
by
New Contributor

Hi, thank you for your message. No, I’m trying to train a model from training samples. I was able to label objects for detection. I was also able to export training samples. Every time I run the analysis I get this error. I’m not sure where the problem lies. 

 

0 Kudos
YPotawsky
New Contributor II

Hey @Aique, It looks like you are using the Resnet-34 Backbone.  Do you receive the same error with resnet-18 or 50?  I was also curious if you did a manual installation of the required Python libraries or utilized the installers found here: https://github.com/Esri/deep-learning-frameworks.  Are you able to import one of the libraries in Pro maybe scikit-learn or torch? Just trying to track down where this error may be coming from.

0 Kudos
zc01
by
New Contributor

hello, im using arcgis pro 3.0 and used the installer from github, i got the same error message when i train a unet with resnet (all of them, 18, 34, 50 ...)

0 Kudos
YPotawsky
New Contributor II

Hi @zc01,  can you elaborate on both the imagery and the training data?  When you labeled objects, what export settings did you utilize? Of particular interest is the output Meta Data format.  Are you able to successfully import torch or fastai in a Notebook within Pro and print a list of functions using the dir() method?   

0 Kudos