12yuens2 / neural-net-tic-tac-toe

A multi-layer feed-forward neural network trained to play tic tac toe.
0 stars 0 forks source link

Error in parser.py #3

Open carloroosen opened 2 months ago

carloroosen commented 2 months ago

parser.py line 39:

nn.weights = np.array(weights)

Gives an error because weights is not a homogenous array:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.

This error only shows up when running play.py

carloroosen commented 2 months ago

This makes sense, because each layer has a different number of weights O it is the first time I see Python. Just got lucky: changed the line into:

nn.weights = weights

and also line 42:

nn.biases= biases

And it works ;)