When I am using nolearn to implement multi-label classification, I got this error:
'Bad input argument to theano function with name "/Users/lm/Documents/anaconda/lib/python2.7/site-packages/nolearn/lasagne/base.py:391" at index 1(0-based)', 'TensorType(float32, matrix) cannot store a value of dtype int64 without risking loss of precision. If you do not mind this loss, you can: 1) explicitly cast your data to float32, or 2) set "allow_input_downcast=True" when calling "function".', array([[0, 0, 0, ..., 0, 0, 1],
As told in the error message, you need to convert your input and output to the appropriate type (if you do not fear losing precision).
should work
Note: even if you do this, the error might remain if you have a
BatchIteratorwhich transforms your data (and by inadvertance usesfloat64again). The solution is the same: inside theBatchIterator, cast the data tofloat32right before returning it.