Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem while running train.py #2

Closed
Sourish97 opened this issue Nov 25, 2019 · 13 comments
Closed

Problem while running train.py #2

Sourish97 opened this issue Nov 25, 2019 · 13 comments

Comments

@Sourish97
Copy link

Sourish97 commented Nov 25, 2019

Hello, I tried to clone your repo and run it on my local system. However when I try a normal python train.py or the command mentioned in sqlova repository, I get the following error

python train.py

BERT-type: uncased_L-12_H-768_A-12
Batch_size = 32
BERT parameters:
learning rate: 1e-05
Fine-tune BERT: False
Traceback (most recent call last):
  File "train.py", line 703, in <module>
    model, model_bert, tokenizer, bert_config = get_models(args, BERT_PT_PATH)
  File "train.py", line 164, in get_models
    args.no_pretraining)
  File "train.py", line 124, in get_bert
    bert_config.print_status()
AttributeError: 'BertConfig' object has no attribute 'print_status'

When I comment out bert_config.print_status(), I get another error as following

BERT-type: uncased_L-12_H-768_A-12
Batch_size = 32
BERT parameters:
learning rate: 1e-05
Fine-tune BERT: False
Traceback (most recent call last):
  File "train.py", line 703, in <module>
    model, model_bert, tokenizer, bert_config = get_models(args, BERT_PT_PATH)
  File "train.py", line 164, in get_models
    args.no_pretraining)
  File "train.py", line 126, in get_bert
    model_bert = BertModel(bert_config)
TypeError: __init__() missing 2 required positional arguments: 'is_training' and 'input_ids'

Any solution to this?

@guotong1988
Copy link
Owner

guotong1988 commented Nov 25, 2019

I have uploaded some code. Please update and try again.

@Sourish97
Copy link
Author

Same error again with the python command you provided

@guotong1988
Copy link
Owner

I have uploaded the config file.

@guotong1988
Copy link
Owner

guotong1988 commented Nov 26, 2019

You should find why bert_config.print_status() fails.

@TobiasBrx
Copy link

I have the same error

@musamaalvi
Copy link

I have the same error

Did you find the solution ?

@siddharthrawal121
Copy link

siddharthrawal121 commented Oct 1, 2020

@Sourish97 @TobiasBrx @musamaalvi Did u guys find anything?

@guotong1988 guotong1988 reopened this Oct 1, 2020
@guotong1988
Copy link
Owner

I will take a look

@musamaalvi
Copy link

@siddharthrawal121 yes,

what I did is simply I stopped importing BertConfig. Comment the below line in your code

from bert.modeling import BertConfig, BertModel

After this copy all the code from bert.modeling file and paste it into train.py. This resolved the issue for me.

@siddharthrawal121
Copy link

siddharthrawal121 commented Oct 1, 2020

Hi @musamaalvi. I tried it didnt work and when I checked the code there is no method or class in bert.config for print_status. Maybe they removed print_status in later version. Which bert version are you using?

@siddharthrawal121
Copy link

@musamaalvi Nvm , fixed the issue by using the the modelling.py in bert folder of NL2SQL-RULE

@guotong1988
Copy link
Owner

guotong1988 commented Oct 9, 2020

it seems export PYTHONPATH=/your/project/root/
I guess.

@siddharthrawal121
Copy link

yes @guotong1988. I solved it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants