Skip to content
New issue

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

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

Already on GitHub? # to your account

Binary string #10

Open
zym3122 opened this issue Jun 21, 2023 · 4 comments
Open

Binary string #10

zym3122 opened this issue Jun 21, 2023 · 4 comments

Comments

@zym3122
Copy link

zym3122 commented Jun 21, 2023

显示无法从txt读取图片路径是为什么?对txt格式有什么要求吗?
ValueError: (InvalidArgument) Failed to parse program_desc from binary string.
[Hint: Expected desc_.ParseFromString(binary_str) == true, but received desc_.ParseFromString(binary_str):0 != true:1.] (at /paddle/paddle/fluid/framework/program_desc.cc:143)

@zym3122
Copy link
Author

zym3122 commented Jun 21, 2023

完整报错为:
Traceback (most recent call last):
File "PaTTA/tools/seg.py", line 40, in
main(args.batch_size, imgs_list, args.crop_size)
File "PaTTA/tools/seg.py", line 21, in main
tta_model = load(args.model_path)
File "PaTTA/tools/seg.py", line 16, in load
model = tta.load_model(path=model_path)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/patta/load_model.py", line 5, in load_model
model = paddle.jit.load(path=path)
File "", line 2, in load
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/wrapped_decorator.py", line 26, in impl
return wrapped_func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 534, in impl
return func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/jit.py", line 1352, in load
return TranslatedLayer._construct(model_path, config)
File "", line 2, in _construct
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/wrapped_decorator.py", line 26, in impl
return wrapped_func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 534, in impl
return func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/io.py", line 1485, in _construct
programs = _construct_program_holders(model_path, model_filename)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/io.py", line 820, in _construct_program_holders
load_program_desc(model_file_path)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/io.py", line 60, in load_program_desc
program_desc = core.ProgramDesc(program_desc_str)
ValueError: (InvalidArgument) Failed to parse program_desc from binary string.
[Hint: Expected desc
.ParseFromString(binary_str) == true, but received desc
.ParseFromString(binary_str):0 != true:1.] (at /paddle/paddle/fluid/framework/program_desc.cc:143)

@zym3122
Copy link
Author

zym3122 commented Jun 21, 2023

我生成的txt为:
data/car_data_2023/JPEGImages/03003.jpg
data/car_data_2023/JPEGImages/07406.jpg
data/car_data_2023/JPEGImages/04275.jpg
data/car_data_2023/JPEGImages/05059.jpg
data/car_data_2023/JPEGImages/00803.jpg

@zym3122
Copy link
Author

zym3122 commented Jun 21, 2023

运行指令为:!python PaTTA/tools/seg.py
配置为:
parser = argparse.ArgumentParser(description='PaTTA Initialization')
parser.add_argument('--model_path', type=str, default='/home/aistudio/work/model')
parser.add_argument('--batch_size', type=int, default=32)
parser.add_argument('--test_dataset', type=str, default='patta.txt')
parser.add_argument('--crop_size', type=tuple, default=(700, 700))
args = parser.parse_args()

@hzy-del
Copy link

hzy-del commented Jan 13, 2024

显示无法从txt读取图片路径是为什么?对txt格式有什么要求吗? ValueError: (InvalidArgument) Failed to parse program_desc from binary string. [Hint: Expected desc_.ParseFromString(binary_str) == true, but received desc_.ParseFromString(binary_str):0 != true:1.] (at /paddle/paddle/fluid/framework/program_desc.cc:143)

你好,请问解决了吗

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

No branches or pull requests

2 participants