zhongkaifu / RNNSharp

RNNSharp is a toolkit of deep recurrent neural network which is widely used for many different kinds of tasks, such as sequence labeling, sequence-to-sequence and so on. It's written by C# language and based on .NET framework 4.6 or above versions. RNNSharp supports many different types of networks, such as forward and bi-directional network, sequence-to-sequence network, and different types of layers, such as LSTM, Softmax, sampled Softmax and others.
BSD 3-Clause "New" or "Revised" License
285 stars 91 forks source link

imncremental training NullReferenceException after last update #33

Closed bill3code closed 7 years ago

bill3code commented 7 years ago

Hello! After the last update, I get this error:

Необработанное исключение: System.AggregateException: Произошла одна или несколько ошибок. ---> System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта. в RNNSharp.SimpleLayer.BackwardPass() в C:\Users\vanin\Documents\GitHub\RNNSharp\RNNSharp\Layers\SimpleLayer.cs:строка 288 в RNNSharp.Networks.ForwardRNN1.ProcessSequenceCRF(Sequence pSequence, RunningMode runningMode) в C:\Users\vanin\Documents\GitHub\RNNSharp\RNNSharp\Networks\FowardRNN.cs:строка 483 в RNNSharp.RNNEncoder1.Process(RNN1 rnn, DataSet1 trainingSet, RunningMode runningMode) в C:\Users\vanin\Documents\GitHub\RNNSharp\RNNSharp\RNNEncoder.cs:строка 81 в System.Threading.Tasks.Parallel.<>cDisplayClass17_0`1.b1() в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) в System.Threading.Tasks.Task.<>cDisplayClass176_0.b0(Object ) --- Конец трассировки внутреннего стека исключений --- в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action1 body) в RNNSharp.RNNEncoder1.Train() в C:\Users\vanin\Documents\GitHub\RNNSharp\RNNSharp\RNNEncoder.cs:строка 227 в RNNSharpConsole.Program.Train() в C:\Users\vanin\Documents\GitHub\RNNSharp\RNNSharpConsole\Program.cs:строка 550 в RNNSharpConsole.Program.Main(String[] args) в C:\Users\vanin\Documents\GitHub\RNNSharp\RNNSharpConsole\Program.cs:строка 310

before update it is working without problems.

My config is :

`CURRENT_DIRECTORY = .\model2cfg

MODEL_TYPE = SEQLABEL

Forward and BiDirectional are supported

NETWORK_TYPE = Forward

MODEL_FILEPATH = model.bin

HIDDEN_LAYER = LSTM:200, LSTM:100

OUTPUT_LAYER = Simple

CRF_LAYER = True

TFEATURE_FILENAME = tfeatures

Binary and Freq are supported

TFEATURE_WEIGHT_TYPE = Freq

TFEATURE_CONTEXT = -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5

PRETRAIN_TYPE = Embedding

WORDEMBEDDING_FILENAME = vector_big.bin

WORDEMBEDDING_CONTEXT = -1,0,1

WORDEMBEDDING_COLUMN = 0

AUTOENCODER_CONFIG = D:\RNNSharpDemoPackage\config_autoencoder.txt

SEQ2SEQ_AUTOENCODER_CONFIG: D:\RNNSharpDemoPackage\config_seq2seq_autoencoder.txt

RTFEATURE_CONTEXT = -2,-1`

bill3code commented 7 years ago

This happens after 47 iterations...

zhongkaifu commented 7 years ago

Hi @bill3code ,

Thanks for letting me know this issue. I have already fixed it. Please sync the latest code.

In addition, the content of configuration file has been updated, please refresh your configuration file according examples in home page.