我在以下Github存储库中运行'resnet50.py'。 https://github.com/anujshah1003/Transfer-Learning-in-keras---custom-data
但是在运行代码时我收到了错误,
- ETA: 5:38:49
4718592/102853048 [>.............................] - ETA: 5:40:22
4726784/102853048 [>.............................] - ETA: 5:41:52
4734976/102853048 [>.............................] - ETA: 5:43:24
4743168/102853048 [>.............................] - ETA: 5:44:10Traceback (most recent call last):
File "C:\CT_SCAN_IMAGE_SET\resnet_50\dbs2017\resnet_3_original.py", line 290, in <module>
model = ResNet50(require_flatten=True, weights='imagenet')
File "C:\CT_SCAN_IMAGE_SET\resnet_50\dbs2017\resnet_3_original.py", line 259, in ResNet50
md5_hash='a7b3fe01876f51b566af0dea6bc144eb')
File "C:\Research\Python_installation\lib\site-packages\keras\utils\data_utils.py", line 221, in get_file
urlretrieve(origin, fpath, dl_progress)
File "C:\Research\Python_installation\lib\urllib\request.py", line 217, in urlretrieve
block = fp.read(bs)
File "C:\Research\Python_installation\lib\http\client.py", line 448, in read
n = self.readinto(b)
File "C:\Research\Python_installation\lib\http\client.py", line 488, in readinto
n = self.fp.readinto(b)
File "C:\Research\Python_installation\lib\socket.py", line 575, in readinto
return self._sock.recv_into(b)
File "C:\Research\Python_installation\lib\ssl.py", line 929, in recv_into
return self.read(nbytes, buffer)
File "C:\Research\Python_installation\lib\ssl.py", line 791, in read
return self._sslobj.read(len, buffer)
File "C:\Research\Python_installation\lib\ssl.py", line 575, in read
v = self._sslobj.read(len, buffer)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
有没有人知道为什么会出现这样的错误?问题在哪里产生?这是为了完成我在uni的研究。
答案 0 :(得分:0)
从错误消息中,Keras尝试从远程服务器下载某些组件,但连接已重置,如果您的Internet连接正常,则可能是由您的ISP引起的。所以你需要先解决连接问题。