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

bugfix for deploy #3313

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions deploy/utils/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ def create_paddle_predictor(self, args, inference_model_dir=None):
) is False, "int8 mode is not supported for fp32 model inference, please set use_int8 as False during inference."

# NOTE: paddle support to PIR mode after v2.6.0
pd_version = 0
for v in paddle.__version__.split(".")[:3]:
pd_version = 10 * pd_version + eval(v)

if pd_version == 0 or pd_version >= 260:
major_v, minor_v, _ = paddle.__version__.split(".")[:3]
major_v, minor_v = int(major_v), int(minor_v)
if (major_v == 0 and minor_v == 0) or (major_v >= 3):
config = Config(inference_model_dir, model_prefix)
else:
model_file = os.path.join(inference_model_dir, f"{model_prefix}.pdmodel")
Expand Down
2 changes: 1 addition & 1 deletion paddleclas.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

__all__ = ["PaddleClas"]

BASE_DIR = os.path.expanduser("~/.paddleclas/")
BASE_DIR = os.path.expanduser(os.path.join("~", ".paddleclas"))
BASE_INFERENCE_MODEL_DIR = os.path.join(BASE_DIR, "inference_model")
BASE_IMAGES_DIR = os.path.join(BASE_DIR, "images")
IMN_MODEL_BASE_DOWNLOAD_URL = "https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/{}_infer.tar"
Expand Down