I am trying to train a model in VS code and have written this code (a part of it):
import tensorflow as tf
import tflearn'
....
tf.reset_default_graph()
net = tflearn.input_data(shape=[None, len(trening[0])])
net = tflearn.fully_connected(net, 8)
net = tflearn.fully_connected(net, 8)
net = tflearn.fully_connected(net, len(output[0]), activation="softmax")
net = tflearn.regression(net)
modell = tflearn.DNN(net)
try:
modell.load("modell.tflearn")
except:
modell.fit(trening, output, n_epoch=1000, batch_size=8, show_metric=True)
modell.save("modell.tflearn")
...
output: raise RuntimeError('Attempted to use a closed Session.') RuntimeError: Attempted to use a closed Session.
I don't understand what I am doing wrong, can someone help?
You can remove
tryandexceptblock and mention only the below lines from except block withouttryandexcept, this should work.