Back to DrivenData | Blog

SSLEOFError when loading resnet34 model

Hi, I have an issue when loading my model. The error information is as follow:

++ find data/test_features -type f -iname '*.tif'
++ head -1
+ '[' -z data/test_features/aaaa/B02.tif ']'
+ '[' -f main.py ']'
+ echo 'Running code submission with Python'
Running code submission with Python
+ conda run --no-capture-output -n condaenv python main.py
/srv/conda/envs/condaenv/lib/python3.9/site-packages/pretrainedmodels/models/dpn.py:255: SyntaxWarning: "is" with a literal. Did you mean "=="?
if block_type is 'proj':
/srv/conda/envs/condaenv/lib/python3.9/site-packages/pretrainedmodels/models/dpn.py:258: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif block_type is 'down':
/srv/conda/envs/condaenv/lib/python3.9/site-packages/pretrainedmodels/models/dpn.py:262: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert block_type is 'normal'
2022-01-12 17:36:39.092 | INFO     | __main__:main:131 - Loading model: /codeexecution/assets/cloud_model.v1.pt
Downloading: "https://download.pytorch.org/models/resnet34-333f7ec4.pth" to /codeexecution/assets/torch/hub/checkpoints/resnet34-333f7ec4.pth
Traceback (most recent call last):
File "/srv/conda/envs/condaenv/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/srv/conda/envs/condaenv/lib/python3.9/http/client.py", line 1279, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/srv/conda/envs/condaenv/lib/python3.9/http/client.py", line 1325, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/srv/conda/envs/condaenv/lib/python3.9/http/client.py", line 1274, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/srv/conda/envs/condaenv/lib/python3.9/http/client.py", line 1034, in _send_output
self.send(msg)
File "/srv/conda/envs/condaenv/lib/python3.9/http/client.py", line 974, in send
self.connect()
File "/srv/conda/envs/condaenv/lib/python3.9/http/client.py", line 1448, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/srv/conda/envs/condaenv/lib/python3.9/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/srv/conda/envs/condaenv/lib/python3.9/ssl.py", line 1040, in _create
self.do_handshake()
File "/srv/conda/envs/condaenv/lib/python3.9/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1129)

Is this because of the network issue in the submission environment?

Thanks.

That’s correct, see if the Runtime network access section of the README can help.

Thank you, that solved this issue.