Comments (5)
Hi, could you provide more detail? Could you share the stacktrace of the error for example?
from declutr.
I got this error at first:
...
File "/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_utils.py", line 625, in from_pretrained
pretrained_model_name_or_path,
OSError: Error no file named ['pytorch_model.bin', 'tf_model.h5', 'model.ckpt.index'] found in directory electra-small or from_tf
set to False
then I set from_tf
to True and I got another error:
...
File "/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_electra.py", line 100, in load_tf_weights_in_electra
assert pointer.shape == array.shape, original_name
AssertionError: ('electra/encoder/layer_0/attention/self/key/bias', torch.Size([252]), (256,))
and when I used bert-base-multilingual-cased(tf version) as a transformer, I got this:
...
model = load_tf2_checkpoint_in_pytorch_model(model, resolved_archive_file, allow_missing_keys=True)
File "/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_tf_pytorch_utils.py", line 252, in load_tf2_checkpoint_in_pytorch_model
tf_model_class = getattr(transformers, tf_model_class_name)
AttributeError: module 'transformers' has no attribute 'TFBertForMaskedLM'
but when I used bert-base-multilingual-cased(pytorch version), it run correctly, so the problem is about load tf1...
from declutr.
Hmm, these errors are coming from the transformers
package, not declutr
. The stack trace shows the following files:
/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_utils.py
/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_electra.py
/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_tf_pytorch_utils.py
What is the value of pretrained_model_name_or_path
? Can you try loading it outside of declutr
, e.g.
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained(pretrained_model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path)
from declutr.
I tried it and got same error:
Traceback (most recent call last):
File..............., line 3, in
model = AutoModel.from_pretrained('/media/2TB_2/ZGH/DontDelet/MyDeCLUTR/DeCLUTR/bert-base-multilingual-cased')
File "/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_auto.py", line 502, in from_pretrained
return model_class.from_pretrained(pretrained_model_name_or_path, *model_args, config=config, **kwargs)
File "/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_utils.py", line 696, in from_pretrained
model = load_tf2_checkpoint_in_pytorch_model(model, resolved_archive_file, allow_missing_keys=True)
File "/media/2TB_2/ZGH/DontDelet/venv3.6.9/lib/python3.6/site-packages/transformers/modeling_tf_pytorch_utils.py", line 252, in load_tf2_checkpoint_in_pytorch_model
tf_model_class = getattr(transformers, tf_model_class_name)
AttributeError: module 'transformers' has no attribute 'TFBertModel'
from declutr.
Right, so this suggests the problem is with transformers
, not declutr
. You may have to ask for help on the transformers
repo!
from declutr.
Related Issues (20)
- Cant set up DECLUTR in local AWS linux machine HOT 2
- argument 'lazy' for dataset_reader HOT 2
- Superclass initialization in token embedder HOT 2
- Could not lex the character code 194 HOT 3
- Minimum text length violated despite preprocessing HOT 2
- How to plot the learning curve from the output logs created post training of declutr? HOT 1
- Impact of "shorter" documents (span, number of tokens) for extended pretraining HOT 7
- Installation issue HOT 8
- Wrong training procedure? HOT 6
- Strange issue occuring during Training HOT 2
- How to integrate a longer sequence model like longformer into declutr architecture HOT 8
- Encoder class breaks for long strings
- can i finetune the model ? HOT 2
- Update DeCLUTR requirements? HOT 5
- How to use a validation dataset when training? HOT 8
- RuntimeError: Error(s) in loading state_dict for DeCLUTR: HOT 2
- Error while encoding HOT 4
- Training with multi gpus HOT 6
- Installation fails in colab notebook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from declutr.