java.lang.NoClassDefFoundError: org/encog/neural/data/NeuralData

Matt's picture

Hi, I've been getting this error alot when using the Backpropagation training method on a FeedForwardPattern network.

I've deleted and re-dowloaded the latest version of encog and serched for bugs in my code to within an inch of its life and cannot find anything.

Here's the code that I think is going wrong... Commenting out this or using a different training methiod (such as genetic or annealing) causes the program to execute.


private void TrainNetwork() throws IOException
{

BasicNeuralDataSet set = new BasicNeuralDataSet(
this.learningInput,
this.learningIdeal
);

Backpropagation train = new Backpropagation(
network.generate(),
set,
0.5, // learning rait
0.5 // momentum
);

int epoch = 0;
int endEpoch = 5000;
do
{
train.iteration();

this.trace("Training: Epoch=" + epoch + " of "+ endEpoch +". Error=" + train.getError() + ".");

double[] point = new double[]{epoch, train.getError()};
this.parent.postCIAgentEvent(
new CIAgentEvent(this, "UPDATE_GUI_ADD_GRAPH_POINT", point));

SerializeObject.save(FILE_PATH, (Serializable) network);

epoch++;
}
while((epoch < endEpoch) && (train.getError() > 0.001));
}

and here's the StackTrace ... which shows something completely different. The constructor here is an empty one.. so I'm pretty sure it's not causing the error...

Exception in thread "Thread-7" java.lang.NoClassDefFoundError: org/encog/neural/data/NeuralData
at ravensbridge.skunkworks.neural.swing.SwingDetectorTrainer.process(SwingDetectorTrainer.java:49)
at ravensbridge.skunkworks.neural.swing.SwingDetectorTrainer.processTimerPop(SwingDetectorTrainer.java:63)
at ciagent.CIAgentTimer.run(CIAgentTimer.java:150)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.encog.neural.data.NeuralData
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 4 more
BUILD SUCCESSFUL (total time: 25 seconds)

Has anyone come across this before, or can help me out?

Chears all,
Matt

SeemaSingh's picture

That has got to be some sort of a classpath issue. NeuralData is a core Encog interface, are you sure the Encog JAR is present when you actually go to run it? If NeuralData is missing, pretty much nothing is going to work.

Matt's picture

I had thought that too,
However, I am only getting this error when using backpropegation... everything else seems to work.

for example, I've replaced the Backpropegation(...) initializer in TrainNetwork to use annealing and genetic training instead, and that works fine.

I'm going to try re-loading all of my Encog libraries again and see of that helps. There may just have been a weird bug while downloading it.

Thanks


Copyright 2005 - 2012 by Heaton Research, Inc.. Heaton Research™ and Encog™ are trademarks of Heaton Research. Click here for copyright, license and trademark information.