Read the error message: a file cannot be found.
At a guess:
File f1 = new File ("weights.txt");
And
weights.txt
does not exist in the exe folder.
Use the debugger to follow your code through and check, then check where the file is and correct your path.