ImportError: cannot import name 'in_dynamic_mode' from 'paddle' (unknown location) #3735
Closed
3 tasks done
Labels
bug
Something isn't working
问题确认 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
是否愿意提交PR? Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: