CIFASIS / neural-fuzzer

http://cifasis.github.io/neural-fuzzer/
GNU General Public License v3.0
90 stars 20 forks source link

error in mtrand #3

Closed roninteger closed 7 years ago

roninteger commented 7 years ago

Tried this fuzzer but doesn't work by default. Don't know howto fix that issue, can you help me?

Ubuntu 16.10

Using TensorFlow backend. Using ./gen-36433103529 to store the generated files Generating a batch of 8 file(s) of size 249 (temp: 0.5 ).Traceback (most recent call last): File "./neural-fuzzer.py", line 221, in recall(model, char_indices, indices_char, text[start_index: start_index + maxlen], test_dir, filename, maxlen, maxgenlen, batch_size) File "./neural-fuzzer.py", line 100, in recall next_index = sample(preds[b], diversity) File "./neural-fuzzer.py", line 32, in sample return np.argmax(np.random.multinomial(1, a, 1)) File "mtrand.pyx", line 4593, in mtrand.RandomState.multinomial (numpy/random/mtrand/mtrand.c:37541) ValueError: sum(pvals[:-1]) > 1.0

Ty

gaa-cifasis commented 7 years ago

Hi,

Sorry for the delay. Can you try using the Theano backend? (I'm using it to develop and test this fuzzer).

roninteger commented 7 years ago

How I can do that? Ty

gaa-cifasis commented 7 years ago

https://keras.io/backend/

roninteger commented 7 years ago

I meant howto config it, --help don't show any argument to select a different backend.

roninteger commented 7 years ago

nvm, I did it and I got the same error msg

Using Theano backend. Using ./gen-0762393394468 to store the generated files Generating a batch of 8 file(s) of size 64 (temp: 0.5 ).Traceback (most recent call last): File "neural-fuzzer.py", line 221, in recall(model, char_indices, indices_char, text[start_index: start_index + maxlen], test_dir, filename, maxlen, maxgenlen, batch_size) File "neural-fuzzer.py", line 100, in recall next_index = sample(preds[b], diversity) File "neural-fuzzer.py", line 32, in sample return np.argmax(np.random.multinomial(1, a, 1)) File "mtrand.pyx", line 4593, in mtrand.RandomState.multinomial (numpy/random/mtrand/mtrand.c:37541) ValueError: sum(pvals[:-1]) > 1.0

roninteger commented 7 years ago

it would be cool if you can share a requirements file to use on my pip installation to check if everything it is fine, versions and so on.

gaa-cifasis commented 7 years ago

Sure. In fact, next week, i was expecting to start refactoring this code and add more information on the installation, examples, how to train, etc.

dkasak commented 6 years ago

Is this still planned? I just ran into the same error. Seems the quick and dirty softmax function that's used can return numbers which sum to a bit more than 1.0 when upcast into float64 inside numpy.random.multinomial.