I wrote a short program in python with fann library (below), it works great
but when I put it into a simple wxGUI there is an error:
FANN Error 10: Error reading info from train data file "zapis.txt", line: 2.
What is wrong?
Does wxPyton change the Python way of reading file?
Program: Dzialanie_sieci.py
#!/usr/bin/python
import fann
connection_rate = 1
learning_rate = 0.7
num_layers = 3
num_input = 319
num_neurons_hidden = 50
num_output = 5
ann = fann.create(connection_rate, learning_rate, (num_layers,num_input,
num_neurons_hidden, num_output))
desired_error = 0.00001
max_iterations = 500000
iterations_between_reports = 1000
ann.train_on_file("zapis.txt", max_iterations, iterations_between_reports,
desired_error)
print ann.get_MSE()
ann.save("po_nauce.net")
ann.destroy()
Simple wxGUI
Program: Trenowanie.py
#!/usr/bin/python
import wx
class TestFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "Trenowanie sieci", pos=(50, 50))
panel = wx.Panel(self)
trenujBtn = wx.Button(panel, -1, "Trenuj Siec", pos=(100, 50))
self.Bind(wx.EVT_BUTTON, self.on_trenujBtn, trenujBtn)
def on_trenujBtn(self, event):
execfile("Dzialanie_sieci.py")
app = wx.PySimpleApp()
frame = TestFrame()
frame.Show()
app.MainLoop()
It just a little part of my application, please help me.
Thanks a lot.
Robert