0

我正在使用迁移学习方法训练 VGG 网络。(微调)但是在训练数据集时,我发现了以下错误,它停止了训练过程。

ETA: 19:00:06
  4407296/553467096 [..............................] - ETA: 19:06:49
  4415488/553467096 [..............................] - ETA: 19:10:23Traceback (most recent call last):
  File "C:\CT_SCAN_IMAGE_SET\vgg\vggTransferLearning.py", line 161, in <module>
    model = vgg16_model(img_rows, img_cols, channel, num_classes)
  File "C:\CT_SCAN_IMAGE_SET\vgg\vggTransferLearning.py", line 120, in vgg16_model
    model = VGG16(weights='imagenet', include_top=True)
  File "C:\Research\Python_installation\lib\site-packages\keras\applications\vgg16.py", line 169, in VGG16
    file_hash='64373286793e3c8b2b4e3219cbf3544b')
  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

有人可以帮我在这里找出问题。

4

1 回答 1

1

当它尝试下载 vgg16 的权重时,由于连接中断而显示错误。尝试手动下载权重。(链接:https ://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5 )

下载权重后,将其放入 keras 文件夹中名为“models”的文件夹中。keras 文件夹默认是隐藏的。

PathToFolder:C:\Users\UserName.keras\models。

完成此设置后,尝试运行代码。

于 2018-05-24T09:28:04.753 回答