由于对等错误 TensorFlow 重置连接

问题描述 投票:0回答:3

我正在尝试使用 TensorFlow 和 Docker 构建图像识别器程序,当我尝试训练分类器时,我不断收到以下错误, 使用此代码:

python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /tf_files/flower_photos

因此:

socket.error: [Errno 104] Connection reset by peer

然后当我再次运行代码时出现错误:

IOError: CRC check failed 0x76f1f85e != 0x6caceac0L

有什么建议吗?

git docker tensorflow ioerror
3个回答
1
投票

解决这个问题后,我发现解压 inception v3 文件时出现错误,因此我必须手动安装 TensorFlow git 上的目录并将其放入 tf_files 目录中,然后删除文件 image_retraining.txt 中的内容。 py 包含 inception v3 文件链接的 DATA_URL 以及使用 DATA_URL 的方法。


0
投票

@Research 2:运行代码时,必须在 tf_files 文件夹中创建名为 inception 的文件夹。 1)删除该文件夹 2)从“http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz”下载文件 3)解压并放入tf_files

现在打开文件 retrain.py 并注释整个方法 def Maybe_download_and_extract() 或从另一个方法 def main(_) 调用此方法,它是此方法中的第 7 行,将其注释掉并尝试再次运行您的代码,它会工作得很好。

@Aritroper:谢谢您的回答


0
投票

我今天在尝试安装tensorflow==2.12.0时遇到了这个问题。 强制将 urllib3 更新到 2.0.4,我工作得很好!

pip install -U urllib3
© www.soinside.com 2019 - 2024. All rights reserved.