We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Textual information for labels?
I seem unable to use text for labels, whilst using to_categorical

```
Using Theano backend.
Traceback (most recent call last):
  File "playground.py", line 88, in <module>
    train_model_and_test(number_of_epochs, number_of_classes, train_data, train_label, augmented_data_generator)
  File "playground.py", line 62, in train_model_and_test
    train_label = np_utils.to_categorical(train_label, number_of_classes)
  File "/usr/local/lib/python2.7/dist-packages/keras/utils/np_utils.py", line 12, in to_categorical
    y = np.asarray(y, dtype='int32')
  File "/usr/lib/python2.7/dist-packages/numpy/core/numeric.py", line 460, in asarray
    return array(a, dtype, copy=False, order=order)
ValueError: invalid literal for int() with base 10: 'yellow'
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `keras/utils/np_utils.py`
Content:
```
1 from __future__ import absolute_import
2 import numpy as np
3 import scipy as sp
4 from six.moves import range
5 from six.moves import zip
6 
7 
8 def to_categorical(y, nb_classes=None):
9     '''Convert class vector (integers from 0 to nb_classes)
10     to binary class matrix, for use with categorical_crossentropy.
11     '''
12     y = np.asarray(y, dtype='int32')
13     if not nb_classes:
14         nb_classes = np.max(y)+1
15     Y = np.zeros((len(y), nb_classes))
16     for i in range(len(y)):
17         Y[i, y[i]] = 1.
18     return Y
19 
20 
21 def normalize(a, axis=-1, order=2):
22     l2 = np.atleast_1d(np.linalg.norm(a, order, axis))
23     l2[l2 == 0] = 1
24     return a / np.expand_dims(l2, axis)
25 
26 
27 def binary_logloss(p, y):
28     epsilon = 1e-15
29     p = sp.maximum(epsilon, p)
30     p = sp.minimum(1-epsilon, p)
31     res = sum(y * sp.log(p) + sp.subtract(1, y) * sp.log(sp.subtract(1, p)))
32     res *= -1.0/len(y)
33     return res
34 
35 
36 def multiclass_logloss(P, Y):
37     npreds = [P[i][Y[i]-1] for i in range(len(Y))]
38     score = -(1. / len(Y)) * np.sum(np.log(npreds))
39     return score
40 
41 
42 def accuracy(p, y):
43     return np.mean([a == b for a, b in zip(p, y)])
44 
45 
46 def probas_to_classes(y_pred):
47     if len(y_pred.shape) > 1 and y_pred.shape[1] > 1:
48         return categorical_probas_to_classes(y_pred)
49     return np.array([1 if p > 0.5 else 0 for p in y_pred])
50 
51 
52 def categorical_probas_to_classes(p):
53     return np.argmax(p, axis=1)
54
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/keras/utils/np_utils.py b/keras/utils/np_utils.py
--- a/keras/utils/np_utils.py
+++ b/keras/utils/np_utils.py
@@ -9,7 +9,6 @@
     '''Convert class vector (integers from 0 to nb_classes)
     to binary class matrix, for use with categorical_crossentropy.
     '''
-    y = np.asarray(y, dtype='int32')
     if not nb_classes:
         nb_classes = np.max(y)+1
     Y = np.zeros((len(y), nb_classes))

{"golden_diff": "diff --git a/keras/utils/np_utils.py b/keras/utils/np_utils.py\n--- a/keras/utils/np_utils.py\n+++ b/keras/utils/np_utils.py\n@@ -9,7 +9,6 @@\n     '''Convert class vector (integers from 0 to nb_classes)\n     to binary class matrix, for use with categorical_crossentropy.\n     '''\n-    y = np.asarray(y, dtype='int32')\n     if not nb_classes:\n         nb_classes = np.max(y)+1\n     Y = np.zeros((len(y), nb_classes))\n", "issue": "Textual information for labels?\nI seem unable to use text for labels, whilst using to_categorical\n\n```\nUsing Theano backend.\nTraceback (most recent call last):\n  File \"playground.py\", line 88, in <module>\n    train_model_and_test(number_of_epochs, number_of_classes, train_data, train_label, augmented_data_generator)\n  File \"playground.py\", line 62, in train_model_and_test\n    train_label = np_utils.to_categorical(train_label, number_of_classes)\n  File \"/usr/local/lib/python2.7/dist-packages/keras/utils/np_utils.py\", line 12, in to_categorical\n    y = np.asarray(y, dtype='int32')\n  File \"/usr/lib/python2.7/dist-packages/numpy/core/numeric.py\", line 460, in asarray\n    return array(a, dtype, copy=False, order=order)\nValueError: invalid literal for int() with base 10: 'yellow'\n```\n\n", "before_files": [{"content": "from __future__ import absolute_import\nimport numpy as np\nimport scipy as sp\nfrom six.moves import range\nfrom six.moves import zip\n\n\ndef to_categorical(y, nb_classes=None):\n    '''Convert class vector (integers from 0 to nb_classes)\n    to binary class matrix, for use with categorical_crossentropy.\n    '''\n    y = np.asarray(y, dtype='int32')\n    if not nb_classes:\n        nb_classes = np.max(y)+1\n    Y = np.zeros((len(y), nb_classes))\n    for i in range(len(y)):\n        Y[i, y[i]] = 1.\n    return Y\n\n\ndef normalize(a, axis=-1, order=2):\n    l2 = np.atleast_1d(np.linalg.norm(a, order, axis))\n    l2[l2 == 0] = 1\n    return a / np.expand_dims(l2, axis)\n\n\ndef binary_logloss(p, y):\n    epsilon = 1e-15\n    p = sp.maximum(epsilon, p)\n    p = sp.minimum(1-epsilon, p)\n    res = sum(y * sp.log(p) + sp.subtract(1, y) * sp.log(sp.subtract(1, p)))\n    res *= -1.0/len(y)\n    return res\n\n\ndef multiclass_logloss(P, Y):\n    npreds = [P[i][Y[i]-1] for i in range(len(Y))]\n    score = -(1. / len(Y)) * np.sum(np.log(npreds))\n    return score\n\n\ndef accuracy(p, y):\n    return np.mean([a == b for a, b in zip(p, y)])\n\n\ndef probas_to_classes(y_pred):\n    if len(y_pred.shape) > 1 and y_pred.shape[1] > 1:\n        return categorical_probas_to_classes(y_pred)\n    return np.array([1 if p > 0.5 else 0 for p in y_pred])\n\n\ndef categorical_probas_to_classes(p):\n    return np.argmax(p, axis=1)\n", "path": "keras/utils/np_utils.py"}], "after_files": [{"content": "from __future__ import absolute_import\nimport numpy as np\nimport scipy as sp\nfrom six.moves import range\nfrom six.moves import zip\n\n\ndef to_categorical(y, nb_classes=None):\n    '''Convert class vector (integers from 0 to nb_classes)\n    to binary class matrix, for use with categorical_crossentropy.\n    '''\n    if not nb_classes:\n        nb_classes = np.max(y)+1\n    Y = np.zeros((len(y), nb_classes))\n    for i in range(len(y)):\n        Y[i, y[i]] = 1.\n    return Y\n\n\ndef normalize(a, axis=-1, order=2):\n    l2 = np.atleast_1d(np.linalg.norm(a, order, axis))\n    l2[l2 == 0] = 1\n    return a / np.expand_dims(l2, axis)\n\n\ndef binary_logloss(p, y):\n    epsilon = 1e-15\n    p = sp.maximum(epsilon, p)\n    p = sp.minimum(1-epsilon, p)\n    res = sum(y * sp.log(p) + sp.subtract(1, y) * sp.log(sp.subtract(1, p)))\n    res *= -1.0/len(y)\n    return res\n\n\ndef multiclass_logloss(P, Y):\n    npreds = [P[i][Y[i]-1] for i in range(len(Y))]\n    score = -(1. / len(Y)) * np.sum(np.log(npreds))\n    return score\n\n\ndef accuracy(p, y):\n    return np.mean([a == b for a, b in zip(p, y)])\n\n\ndef probas_to_classes(y_pred):\n    if len(y_pred.shape) > 1 and y_pred.shape[1] > 1:\n        return categorical_probas_to_classes(y_pred)\n    return np.array([1 if p > 0.5 else 0 for p in y_pred])\n\n\ndef categorical_probas_to_classes(p):\n    return np.argmax(p, axis=1)\n", "path": "keras/utils/np_utils.py"}]}