Forums

BlockingIOError: [Errno 11] write could not complete without blocking

The model.fit is giving away error....

File "/var/www/sapreparth_pythonanywhere_com_wsgi.py", line 19, in <module>
from bot import app as application
File "./bot.py", line 81, in <module>
model.fit(training, output, n_epoch=1000, batch_size=8, show_metric=True)

The code is as follows:

training = np.array(training)
output = np.array(output)


ops.reset_default_graph()

net = tflearn.input_data(shape=[None, len(training[0])]) #create a neuron layer followed by 2 others
net = tflearn.fully_connected(net, 8)
net = tflearn.fully_connected(net, 8)
net = tflearn.fully_connected(net, len(output[0]), activation="softmax") #give probability to o/p neurons
net = tflearn.regression(net)

model = tflearn.DNN(net) #create tensorflow neural net type

try:
    t
    model.load("model.tflearn")
except:
    model.fit(training, output, n_epoch=1000, batch_size=8, show_metric=True)#fit the model
    model.save("model.tflearn")

[edit by admin: formatting]

My guess is that your code is printing out lots of stuff (perhaps as a side-effect of one of those calls), and that's blocking while trying to write to the logfile.

I assume that's Keras code -- if so, try adding the extra argument verbose=0 to the call to model.fit.