“UserWarning: An input could not be retrieved. It could be because a worker has died. We do not have any information on the lost sample.”

眉间皱痕 提交于 2020-03-22 03:57:07

问题


While training model I got this warning "UserWarning: An input could not be retrieved. It could be because a worker has died.We do not have any information on the lost sample.)", after showing this warning, model starts training. What does this warning means? Is it something that will affect my training and I need to worry about?


回答1:


This is just a user warning that will be usually thrown when you try to fetch the inputs,targets during training. This is because a timeout is set for the queuing mechanism which will be specified inside the data_utils.py.

For more details you can refer the data_utils.py file which will be inside the keras/utils folder.

https://github.com/keras-team/keras/blob/master/keras/utils/data_utils.py




回答2:


I got the same warning when training a model in Google Colab. The problem was that I tried to fetch the data from my Google Drive that I had mounted to the Colab session. The solution was to move the data into Colab's working directory and use it from there. This can be done simply via !cp -r path/to/google_drive_data_dir/ path/to/colab_data_dir in the notebook. Note that you will have to do this each time when a new Colab session is created.

This may or may not be the problem that Rahul was asking, but I think this might be helpful to others who face the issue.




回答3:


make sure the path of data set you have given is correct only..this definitely helps example:train_data_dir="/content/drive/My Drive/Colab Notebooks/dataset"




回答4:


I faced the same issue while training a deep neural network on my machine using keras, and it took me a while to figure it out. The images I was loading using the

ImageDataGenerator(target_size = (256, 256))

from

keras.preprocessing 

were of a lower resolution, say 100*100 and I was trying to convert them into 256*256, and apparently there is no inbuilt support provided for this.

As soon as I fixed the output shape of the image returned by the ImageDataGenerator, the warning vanished.

//Note: the figures 100*100 and 255*255 are just for explanation.



来源:https://stackoverflow.com/questions/58446290/userwarning-an-input-could-not-be-retrieved-it-could-be-because-a-worker-has

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!