title: AttributeError: module 'cupy' has no attribute 'scatter_add'
body: <p>When trying to run a model for spacy NER training with</p>
  <blockquote>
  <p>spacy.require_gpu()</p>
  </blockquote>
  <p>I got this error:</p>
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-6-a86608cac558&gt; in &lt;module&gt;
        3 }
        4 start_time = time.time()
  ----&gt; 5 train_model(data)
  
  &lt;ipython-input-2-10f04ac303a6&gt; in train_model(train_data)
       82     other_pipes = [pipe for pipe in nlp.pipe_names if pipe != 'ner']
       83     with nlp.disable_pipes(*other_pipes):
  ---&gt; 84         optimizer = nlp.begin_training()
       85         for itn in range(1):
       86             print(&quot;Starting iteration &quot; + str(itn))
  
  c:\users\aventus\envs\py38\lib\site-packages\spacy\language.py in begin_training(self, get_gold_tuples, sgd, component_cfg, **cfg)
      623                 kwargs = component_cfg.get(name, {})
      624                 kwargs.update(cfg)
  --&gt; 625                 proc.begin_training(
      626                     get_gold_tuples,
      627                     pipeline=self.pipeline,
  
  nn_parser.pyx in spacy.syntax.nn_parser.Parser.begin_training()
  
  _parser_model.pyx in spacy.syntax._parser_model.ParserModel.begin_training()
  
  c:\users\aventus\envs\py38\lib\site-packages\thinc\check.py in checked_function(wrapped, instance, args, kwargs)
      154                     raise ExpectedTypeError(check, [&quot;Callable&quot;])
      155                 check(arg_id, fix_args, kwargs)
  --&gt; 156         return wrapped(*args, **kwargs)
      157 
      158     def arg_check_adder(func):
  
  c:\users\aventus\envs\py38\lib\site-packages\thinc\neural\_classes\model.py in begin_training(self, train_X, train_y, **trainer_cfg)
      120     def begin_training(self, train_X, train_y=None, **trainer_cfg):
      121         for hook in self.on_data_hooks:
  --&gt; 122             hook(self, train_X, train_y)
      123         return self.Trainer(self, **trainer_cfg)
      124 
  
  c:\users\aventus\envs\py38\lib\site-packages\spacy\_ml.py in &lt;lambda&gt;(model, X, y)
      149 
      150 @describe.on_data(
  --&gt; 151     _set_dimensions_if_needed, lambda model, X, y: model.init_weights(model)
      152 )
      153 @describe.attributes(
  
  c:\users\aventus\envs\py38\lib\site-packages\spacy\_ml.py in init_weights(model)
      268         t_i = 0
      269         for t_i in range(t_max):
  --&gt; 270             acts1 = predict(ids, tokvecs)
      271             var = model.ops.xp.var(acts1)
      272             mean = model.ops.xp.mean(acts1)
  
  c:\users\aventus\envs\py38\lib\site-packages\spacy\_ml.py in predict(ids, tokvecs)
      254                 (hiddens.shape[0] * model.nF, model.nO * model.nP)
      255             )
  --&gt; 256             model.ops.scatter_add(vectors, ids.flatten(), hiddens)
      257             vectors = vectors.reshape((vectors.shape[0], model.nO, model.nP))
      258             vectors += model.b
  
  ops.pyx in thinc.neural.ops.CupyOps.scatter_add()
  
  c:\users\aventus\envs\py38\lib\site-packages\cupy\__init__.py in __getattr__(name)
      873         value = _deprecated_attrs.get(name)
      874         if value is None:
  --&gt; 875             raise AttributeError(
      876                 f&quot;module 'cupy' has no attribute {name!r}&quot;)
      877         attr, eq_attr = value
  
  AttributeError: module 'cupy' has no attribute 'scatter_add'
  </code></pre>
  <p>The data used for training the model is annotation for spacy NER.</p>
  <p>When running spacy.require_gpu() got this:</p>
  <pre><code>Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt;import spacy
  &gt;&gt;&gt;spacy.require_gpu()
  True
  </code></pre>
  <ul>
  <li>Os - Windows 10</li>
  <li>Python 3.8</li>
  <li>spacy 2.2.4</li>
  <li>cupy 9.0.0</li>
  <li>Nvidia Driver Version: 466.11</li>
  <li>CUDA Version: 11.1</li>
  <li>NVIDIA GeForce GTX 1660Ti</li>
  </ul>
  <p>How to get rid of this error? Any help will be greatly appreciated.</p>