You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to load the xlnet-base-cased transformer raises the following error.
Some weights of the model checkpoint at xlnet-base-cased were not used when initializing XLNetModel: ['lm_loss.weight', 'lm_loss.bias']
- This IS expected if you are initializing XLNetModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing XLNetModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_2292405/1170947513.py in<module>
1 config = Config().from_str(default_model_config)
2 model = spacy.registry.resolve(config)["model"]
----> 3 model.initialize()
~/.local/share/virtualenvs/mlgec-87_FmqUT/lib/python3.8/site-packages/thinc/model.py in initialize(self, X, Y)
297 validate_fwd_input_output(self.name, self._func, X, Y)
298 if self.init is not None:
--> 299 self.init(self, X=X, Y=Y)
300 return self
301
~/.local/share/virtualenvs/mlgec-87_FmqUT/lib/python3.8/site-packages/thinc/layers/chain.py in init(model, X, Y)
70 if X is None and Y is None:
71 forlayerin model.layers:
---> 72 layer.initialize()
73 if model.layers[0].has_dim("nI"):
74 model.set_dim("nI", model.layers[0].get_dim("nI"))
~/.local/share/virtualenvs/mlgec-87_FmqUT/lib/python3.8/site-packages/thinc/model.py in initialize(self, X, Y)
297 validate_fwd_input_output(self.name, self._func, X, Y)
298 if self.init is not None:
--> 299 self.init(self, X=X, Y=Y)
300 return self
301
~/.local/share/virtualenvs/mlgec-87_FmqUT/lib/python3.8/site-packages/thinc/layers/chain.py in init(model, X, Y)
70 if X is None and Y is None:
71 forlayerin model.layers:
---> 72 layer.initialize()
73 if model.layers[0].has_dim("nI"):
74 model.set_dim("nI", model.layers[0].get_dim("nI"))
~/.local/share/virtualenvs/mlgec-87_FmqUT/lib/python3.8/site-packages/thinc/model.py in initialize(self, X, Y)
297 validate_fwd_input_output(self.name, self._func, X, Y)
298 if self.init is not None:
--> 299 self.init(self, X=X, Y=Y)
300 return self
301
~/.local/share/virtualenvs/mlgec-87_FmqUT/src/spacy-transformers/spacy_transformers/layers/transformer_model.py in init(model, X, Y)
152 if"output_attentions"in trf_cfg and trf_cfg["output_attentions"] is True:
153 tensors = tensors[:-1] # remove attention
--> 154 t_i = find_last_hidden(tensors)
155 model.set_dim("nO", tensors[t_i].shape[-1])
156
~/.local/share/virtualenvs/mlgec-87_FmqUT/src/spacy-transformers/spacy_transformers/util.py in find_last_hidden(tensors)
80 """ 81 for i, tensor in reversed(list(enumerate(tensors))):---> 82 if len(tensor.shape) == 3: 83 return i 84 else:AttributeError: 'tuple' object has no attribute 'shape'
How to reproduce the behaviour
Trying to load the
xlnet-base-cased
transformer raises the following error.Our Environment
Info about spaCy
The text was updated successfully, but these errors were encountered: