I am downloading via
model = models.__dict__['resnet152'](pretrained = True)
I got the following exception after downloading about 4%. The error occurs repeatedly.
Downloading: "https://download.pytorch.org/models/resnet152-b121ed2d.pth" to C:\Users\ni/.torch\models\resnet152-b121ed2d.pth
4%|████▋ | 10641408/241530880
Traceback (most recent call last):
File "E:\ni\Software\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 285, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "E:\ni\Software\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1814, in recv_into
self._raise_ssl_error(self._ssl, result)
File "E:\ni\Software\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1631, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (10054, 'WSAECONNRESET')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\ni\Software\Anaconda3\lib\site-packages\urllib3\response.py", line 331, in _error_catcher
yield
File "E:\ni\Software\Anaconda3\lib\site-packages\urllib3\response.py", line 413, in read
data = self._fp.read(amt)
File "E:\ni\Software\Anaconda3\lib\http\client.py", line 447, in read
n = self.readinto(b)
File "E:\ni\Software\Anaconda3\lib\http\client.py", line 491, in readinto
n = self.fp.readinto(b)
File "E:\ni\Software\Anaconda3\lib\socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "E:\ni\Software\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 290, in recv_into
raise SocketError(str(e))
OSError: (10054, 'WSAECONNRESET')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "WatermarkTrainingResNetDenseNetInception_pytorch.py", line 288, in <module>
main(args)
File "WatermarkTrainingResNetDenseNetInception_pytorch.py", line 229, in main
model = models.__dict__[args.model_name](pretrained=True)
File "E:\ni\Software\Anaconda3\lib\site-packages\torchvision\models\resnet.py", line 212, in resnet152
model.load_state_dict(model_zoo.load_url(model_urls['resnet152']))
File "E:\ni\Software\Anaconda3\lib\site-packages\torch\utils\model_zoo.py", line 65, in load_url
_download_url_to_file(url, cached_file, hash_prefix, progress=progress)
File "E:\ni\Software\Anaconda3\lib\site-packages\torch\utils\model_zoo.py", line 88, in _download_url_to_file
buffer = u.read(8192)
File "E:\ni\Software\Anaconda3\lib\site-packages\urllib3\response.py", line 430, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "E:\ni\Software\Anaconda3\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "E:\ni\Software\Anaconda3\lib\site-packages\urllib3\response.py", line 349, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: OSError("(10054, \'WSAECONNRESET\')")', OSError("(10054, 'WSAECONNRESET')"))