PaddlePaddle / PaddleSeg

Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, 3D Segmentation, etc.
https://arxiv.org/abs/2101.06175
Apache License 2.0
8.63k stars 1.68k forks source link

[General Issue] ValueError: (InvalidArgument) fill_constant(): argument (position 6) must be float, but got str (at ..\paddle\fluid\pybind\op_function_common.cc:189) #2364

Closed monkeycc closed 2 years ago

monkeycc commented 2 years ago

欢迎您反馈PaddleSeg使用问题,辛苦您提供以下信息,方便我们快速定位和解决问题:

  1. PaddleSeg版本:(paddleseg 2.5.0)
  2. PaddlePaddle版本:(paddlepaddle-gpu 2.3.0.post112)
  3. 操作系统信息:(Windows)
  4. Python版本号:(Python3.7)
  5. CUDA/cuDNN版本:(cuda11.2 cudnn8.2)
  6. 其他内容: (增加其他与问题相关的内容)
 python predict.py  
--config   configs/pp_liteseg/pp_liteseg_stdc1_camvid_960x720_10k.yml  
--model_path D:/PaddleSeg/0Pdparams/aaa/model.pdiparams  
--image_path F:/00Biaozhu/aaa/aaa.jpg  
--save_dir output/result_predict

------------------------------------------------
W0723 14:44:11.792466 19616 gpu_context.cc:278] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.6, Runtime API Version: 11.2
W0723 14:44:11.793423 19616 gpu_context.cc:306] device: 0, cuDNN Version: 8.2.
2022-07-23 14:44:14 [INFO]      Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/PP_STDCNet1.tar.gz
2022-07-23 14:44:14 [INFO]      There are 145/145 variables loaded into STDCNet.
2022-07-23 14:44:14 [INFO]      Number of predict images = 1
2022-07-23 14:44:14 [INFO]      Loading pretrained model from D:/PaddleSeg/0Pdparams/aaa/model.pdiparams
Traceback (most recent call last):
  File "predict.py", line 185, in <module>
    main(args)
  File "predict.py", line 180, in main
    **test_config)
  File "D:\0SDXX\PaddleSeg\paddleseg\core\predict.py", line 84, in predict
    utils.utils.load_entire_model(model, model_path)
  File "D:\0SDXX\PaddleSeg\paddleseg\utils\utils.py", line 39, in load_entire_model
    load_pretrained_model(model, pretrained)
  File "D:\0SDXX\PaddleSeg\paddleseg\utils\utils.py", line 87, in load_pretrained_model
    if k not in para_state_dict:
  File "D:\anaconda3\envs\PaddleSeg\lib\site-packages\paddle\fluid\dygraph\math_op_patch.py", line 258, in __impl__
    value=other_var, dtype=lhs_dtype)
  File "D:\anaconda3\envs\PaddleSeg\lib\site-packages\paddle\fluid\dygraph\math_op_patch.py", line 90, in create_scalar
    return create_tensor(value, dtype, shape=[1])
  File "D:\anaconda3\envs\PaddleSeg\lib\site-packages\decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "D:\anaconda3\envs\PaddleSeg\lib\site-packages\paddle\fluid\dygraph\base.py", line 299, in __impl__
    return func(*args, **kwargs)
  File "D:\anaconda3\envs\PaddleSeg\lib\site-packages\paddle\fluid\dygraph\math_op_patch.py", line 85, in create_tensor
    value, 'force_cpu', False)
ValueError: (InvalidArgument) fill_constant(): argument (position 6) must be float, but got str (at ..\paddle\fluid\pybind\op_function_common.cc:189)
monkeycc commented 2 years ago

--model_path D:/PaddleSeg/0Pdparams/aaa/model.pdiparams
这个是导出模型的模型

应该改为 训练模型