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

ImportError: cannot import name 'in_dynamic_mode' from 'paddle' (unknown location) #3735

Closed
3 tasks done
1a1aca opened this issue Jun 8, 2024 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@1a1aca
Copy link

1a1aca commented Jun 8, 2024

问题确认 Search before asking

Bug描述 Describe the Bug

执行导出预测模型时也出现此错误

复现环境 Environment

PS E:\Python Projects\PaddleSegTest2_8\PaddleSeg\contrib\PP-HumanSeg> cd PP-LiteSeg
PS E:\Python Projects\PaddleSegTest2_8\PaddleSeg\contrib\PP-HumanSeg\PP-LiteSeg> python ../../../tools/export.py --config configs/pp_liteseg/pp_liteseg_stdc1_cityscapes_1024x512_scale0.5_160k.yml --model_path PP-LiteSeg/model.pdparams --save_dir inference_model
Traceback (most recent call last):
File "E:\Python Projects\PaddleSegTest2_8\PaddleSeg\tools\export.py", line 21, in
from paddleseg.cvlibs import Config, SegBuilder
File "D:\Users\Administrator\anaconda3\envs\paddle22\lib\site-packages\paddleseg_init_.py", line 15, in
from . import models, datasets, transforms, optimizers
File "D:\Users\Administrator\anaconda3\envs\paddle22\lib\site-packages\paddleseg\models_init_.py", line 15, in
from .backbones import *
File "D:\Users\Administrator\anaconda3\envs\paddle22\lib\site-packages\paddleseg\models\backbones_init_.py", line 15, in
from .hrnet import *
File "D:\Users\Administrator\anaconda3\envs\paddle22\lib\site-packages\paddleseg\models\backbones\hrnet.py", line 18, in
import paddle.nn as nn
File "D:\Users\Administrator\anaconda3\envs\paddle22\lib\site-packages\paddle\nn_init_.py", line 15, in
from . import functional, initializer, quant, utils # noqa: F401
File "D:\Users\Administrator\anaconda3\envs\paddle22\lib\site-packages\paddle\nn\functional_init_.py", line 18, in
from .activation import (
File "D:\Users\Administrator\anaconda3\envs\paddle22\lib\site-packages\paddle\nn\functional\activation.py", line 16, in
from paddle import _C_ops, _legacy_C_ops, in_dynamic_mode
ImportError: cannot import name 'in_dynamic_mode' from 'paddle' (unknown location)
PS E:\Python Projects\PaddleSegTest2_8\PaddleSeg\contrib\PP-HumanSeg\PP-LiteSeg>

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@1a1aca 1a1aca added the bug Something isn't working label Jun 8, 2024
@TingquanGao
Copy link
Collaborator

Thanks for this issue. As it has been inactive for a long time, we would close it. If you has any questions, please feel free to reopen or new issue, and we will follow up and resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants