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

报错module 'paddle.fluid.dygraph' has no attribute 'load_dygraph',请问怎么解决 #39

Open
BearsEatLardCake opened this issue Dec 26, 2023 · 2 comments

Comments

@BearsEatLardCake
Copy link

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ c:\Users\n\Desktop\uie_pytorch-main (1)\uie_predictor.py:680 in │
│ │
│ 677 │ args.schema = ['航母'] │
│ 678 │ args.schema_lang = "en" │
│ 679 │ uie = UIEPredictor(model=args.model, task_path=args.task_path, schema_lang=args.sche │
│ ❱ 680 │ │ │ │ │ position_prob=args.position_prob, max_seq_len=args.max_seq_len, b │
│ 681 │ print(uie("印媒所称的“印度第一艘国产航母”—“维克兰特”号")) │
│ 682 │
│ │
│ c:\Users\n\Desktop\uie_pytorch-main (1)\uie_predictor.py:147 in init
│ │
│ 144 │ │ self._is_en = True if model in ['uie-base-en' │
│ 145 │ │ │ │ │ │ │ │ │ │ ] or schema_lang == 'en' else False │
│ 146 │ │ self.set_schema(schema) │
│ ❱ 147 │ │ self._prepare_predictor() │
│ 148 │ │
│ 149 │ def _prepare_predictor(self): │
│ 150 │ │ assert self._engine in ['pytorch', │
│ │
│ c:\Users\n\Desktop\uie_pytorch-main (1)\uie_predictor.py:158 in _prepare_predictor │
│ │
│ 155 │ │ │ if not os.path.exists(self._task_path): │
│ 156 │ │ │ │ from convert import check_model, extract_and_convert │
│ 157 │ │ │ │ check_model(self._model) │
│ ❱ 158 │ │ │ │ extract_and_convert(self._model, self._task_path) │
│ 159 │ │ │
│ 160 │ │ if self._multilingual: │
│ 161 │ │ │ from tokenizer import ErnieMTokenizerFast │
│ │
│ c:\Users\n\Desktop\uie_pytorch-main (1)\convert.py:292 in extract_and_convert │
│ │
│ 289 │ │ import paddle.fluid.dygraph as D │
│ 290 │ │ from paddle import fluid │
│ 291 │ │ with fluid.dygraph.guard(): │
│ ❱ 292 │ │ │ paddle_paddle_params, _ = D.load_dygraph( │
│ 293 │ │ │ │ os.path.join(input_dir, 'model_state')) │
│ 294 │ else: │
│ 295 │ │ paddle_paddle_params = pickle.load( │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'paddle.fluid.dygraph' has no attribute 'load_dygraph'

@zhuchenxi
Copy link

同问

@Chris-Mraz
Copy link

同问,请问有办法解决吗

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

3 participants