Comments (6)
Hum I will see if I can let people import any kind of TF model in PyTorch, that's a bit risky so it has to be done properly.
In the meantime you can add global_step
in the list line 53 of convert_tf_checkpoint_to_pytorch.py
from transformers.
Maybe some additional information could help me help you?
from transformers.
Initialize PyTorch weight ['cls', 'seq_relationship', 'output_weights']
Skipping cls/seq_relationship/output_weights/adam_m
Skipping cls/seq_relationship/output_weights/adam_v
Traceback (most recent call last):
File "/home/tiandan.cxj/python/model_serving_python/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/tiandan.cxj/python/model_serving_python/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/tiandan.cxj/platform/pytorch_BERT/pytorch-pretrained-BERT/pytorch_pretrained_bert/main.py", line 19, in
convert_tf_checkpoint_to_pytorch(TF_CHECKPOINT, TF_CONFIG, PYTORCH_DUMP_OUTPUT)
File "/home/tiandan.cxj/platform/pytorch_BERT/pytorch-pretrained-BERT/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py", line 69, in convert_tf_checkpoint_to_pytorch
pointer = getattr(pointer, l[0])
File "/home/tiandan.cxj/python/model_serving_python/lib/python3.5/site-packages/torch/nn/modules/module.py", line 518, in getattr
type(self).name, name))
AttributeError: 'BertForPreTraining' object has no attribute 'global_step'
from transformers.
@thomwolf sir, i am also same issue. it doen't resolve. how i am convert my finetuned pretrained model to pytorch?
export BERT_BASE_DIR=/home/dell/backup/NWP/bert-base-uncased/bert_tensorflow_e100
pytorch_pretrained_bert convert_tf_checkpoint_to_pytorch \
$BERT_BASE_DIR/model.ckpt-100 \
$BERT_BASE_DIR/bert_config.json \
$BERT_BASE_DIR/pytorch_model.bin
Traceback (most recent call last):
File "/home/dell/Downloads/Downloads/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/dell/Downloads/Downloads/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/dell/backup/bert_env/lib/python3.6/site-packages/pytorch_pretrained_bert/__main__.py", line 19, in <module>
convert_tf_checkpoint_to_pytorch(TF_CHECKPOINT, TF_CONFIG, PYTORCH_DUMP_OUTPUT)
File "/home/dell/backup/bert_env/lib/python3.6/site-packages/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py", line 69, in convert_tf_checkpoint_to_pytorch
pointer = getattr(pointer, l[0])
File "/home/dell/backup/bert_env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 535, in __getattr__
type(self).__name__, name))
AttributeError: 'BertForPreTraining' object has no attribute 'global_step'
sir how to resolve this issue?
thanks.
from transformers.
thanks @thomwolf sir. it was resolved.
from transformers.
I added the global_step to the skipping list in the modelling.py . Still facing the error. Am I missing something?
from transformers.
Related Issues (20)
- try eval befor train gives ValueError with deepspeed Zero2
- `BartForConditionalGeneration` has no attribute `shared` HOT 1
- OPRO-FT- config.json file not loaded -Andyrasika/Mistral7b-ORPO HOT 3
- EncoderDecoderModel with XLM-R
- Mamba: which tokenizer has been saved and how to use it? HOT 1
- Create panoptic segmentation task guide
- Error at the generation stage by MusicGen stereo model HOT 3
- Trying to stack tensors from different devices in `_pad_to_max_length` in Whisper batched inference
- [Whisper] Word-level timestamps broken for short-form audio HOT 2
- [BUG] Load StarCoder2 AWQ using Transformers HOT 5
- `import transformers` accidentally initializing both torch and jax/xla at startup time HOT 5
- FSDP Doesn't Work with model.generate() HOT 2
- Nondeterministic behavior from GPT with MPS backend HOT 6
- LlamaRMSNorm() Dtype Casting Error HOT 1
- Trainer do not move the model to GPU when doing evaluation with FSDP
- [i18n-PL] Translating docs to Polish HOT 3
- PEFT models donot "override" user's argument for return_full_text. HOT 2
- There is a probability that a bug will be triggered when tracing the llama model: torch.fx.proxy.TraceError: symbolically traced variables cannot be used as inputs to control flow HOT 1
- Couldn't connect to `https://huggingface.co`. HOT 1
- MPS memory leak?
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 transformers.