如何解决UnavailableError:找到7个根错误并使用TPU,我收到此错误如何解决
from tensorflow.keras.callbacks import ModelCheckpoint,CSVLogger
checkpointer = ModelCheckpoint(filepath='/content/drive/My Drive/Covid-Detection-using-Lung-Xray-Images-master/cdac/Saved/Checkpoint/modelfinal0_100.{epoch:02d}.hdf5',verbose=1,save_best_only=True,monitor = 'val_loss')
csv_logger = CSVLogger('/content/drive/My Drive/Covid-Detection-using-Lung-Xray-Images-master/cdac/Saved/Log/model0.log')
history=model.fit_generator(
train_generator,steps_per_epoch = train_generator.samples // batch_size,validation_data = validation_generator,validation_steps = validation_generator.samples // batch_size,epochs = 20,callbacks=[csv_logger,checkpointer])
model.save('/content/drive/My Drive/Covid-Detection-using-Lung-Xray-Images-master/cdac/model/model_final_100v2.hdf5',overwrite=True,include_optimizer=True)
在google collab中运行此命令后,出现错误。我使用TPU运行此程序,该程序与使用X射线肺部图像进行Covid19检测有关。它分为正常,肺炎和Covid 3类。我在此代码的前面部分使用驱动器准备数据并提取了zip文件。文件路径已正确给出。请帮忙。预先感谢
错误:
Epoch 1/20
---------------------------------------------------------------------------
UnavailableError Traceback (most recent call last)
<ipython-input-17-ae8b80faaa4d> in <module>()
10 validation_steps = validation_generator.samples // batch_size,11 epochs = 20,---> 12 callbacks=[csv_logger,checkpointer])
13
14 model.save('/content/drive/My Drive/Covid-Detection-using-Lung-Xray-Images-master/cdac/model/model_final_100v2.hdf5',include_optimizer=True)
14 frames
/usr/local/lib/python3.6/dist-packages/six.py in raise_from(value,from_value)
UnavailableError: 7 root error(s) found.
(0) Unavailable: {{function_node __inference_train_function_41676}} failed to connect to all addresses
Additional GRPC error information from remote target /job:localhost/replica:0/task:0/device:CPU:0:
:{"created":"@1597873146.970016559","description":"Failed to pick subchannel","file":"third_party/grpc/src/core/ext/filters/client_channel/client_channel.cc","file_line":3948,"referenced_errors":[{"created":"@1597873146.808044681","description":"failed to connect to all addresses","file":"third_party/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":394,"grpc_status":14}]}
[[{{node MultiDeviceIteratorGetNextFromShard}}]]
[[RemoteCall]]
[[IteratorGetNextAsOptional]]
[[strided_slice_57/_252]]
(1) Unavailable: {{function_node __inference_train_function_41676}} failed to connect to all addresses
Additional GRPC error information from remote target /job:localhost/replica:0/task:0/device:CPU:0:
:{"created":"@1597873146.970016559","grpc_status":14}]}
[[{{node MultiDeviceIteratorGetNextFromShard}}]]
[[RemoteCall]]
[[IteratorGetNextAsOptional]]
[[strided_slice_91/_288]]
(2) Unavailable: {{function_node __inference_train_function_41676}} failed to connect to all addresses
Additional GRPC error information from remote target /job:localhost/replica:0/task:0/device:CPU:0:
:{"created":"@1597873146.970016559","grpc_status":14}]}
[[{{node MultiDeviceIteratorGetNextFromShard}}]]
[[RemoteCall]]
[[IteratorGetNextAsOptional]]
[[strided_slice_126/_166]]
(3) Unavailable: {{function_node __inference_train_function_41676}} failed to connect to all addresses
Additional GRPC error information from remote target /job:localhost/replica:0/task:0/device:CPU:0:
:{"created":"@1597873146.970016559","grpc_status":14}]}
[[{{node MultiDeviceIteratorGetNextFromShard}}]]
[[RemoteCall]]
[[IteratorGetNextAsOptional]]
[[TPUReplicate/_compile/_4505907264126063010/_4/_238]]
(4) Unavailable: {{function_n ... [truncated]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。