Hardware
CPU noavx
Environment Information
platform: Windows-10-10.0.19041-SP0
Python: 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
Paddle compiled with cuda: False
GCC: gcc (Rev10, Built by MSYS2 project) 12.2.0
PaddleSeg: 2.8.0
PaddlePaddle: 2.4.2
OpenCV: 4.5.5
Library
Paddlepaddle version: 2.4.1 (Compiled noavx *.whl)
I did all steps by these instructions
When I run:
python tools/predict.py --config configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml --model_path pretrained_models/ppmattingv2-stdc1-human_512.pdparams --image_path demo/human.jpg --save_dir output/results --device CPU
I get this error:
python tools/predict.py --config configs/ppmattingv2/ppmattingv2-stdc1-human_512.yml --model_path pretrained_models/ppmattingv2-stdc1-human_512.pdparams --image_path demo/human.jpg --save_dir output/results --fg_estimate True --device CPU
D:\paddleseg_python3.8.0\WPy64-3.8.0.0\python-3.8.0.amd64\lib\site-packages\pkg_resources\__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
D:\paddleseg_python3.8.0\WPy64-3.8.0.0\python-3.8.0.amd64\lib\site-packages\pkg_resources\__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
D:\paddleseg_python3.8.0\WPy64-3.8.0.0\python-3.8.0.amd64\lib\site-packages\pkg_resources\__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
D:\paddleseg_python3.8.0\WPy64-3.8.0.0\python-3.8.0.amd64\lib\site-packages\pkg_resources\__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zope')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
D:\paddleseg_python3.8.0\PaddleSeg\Matting\tools\..\ppmatting\metrics\metric.py:23: DeprecationWarning: Please use `convolve` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
from scipy.ndimage.filters import convolve
2023-05-01 20:09:41 [INFO]
------------------------------------------------
2023-05-01 20:09:41 [INFO]
---------------Config Information---------------
batch_size: 16
iters: 100000
train_dataset:
dataset_root: data/PPM-100
mode: train
train_file: train.txt
transforms:
- type: LoadImages
- max_short: 512
type: LimitShort
- crop_size:
- 512
- 512
type: RandomCrop
- target_size:
- 512
- 512
type: Padding
- type: RandomDistort
- prob: 0.1
type: RandomBlur
- prob: 0.2
type: RandomSharpen
- prob: 0.5
type: RandomNoise
- prob: 0.2
type: RandomReJpeg
- type: RandomHorizontalFlip
- type: Normalize
type: MattingDataset
val_dataset:
dataset_root: data/PPM-100
get_trimap: false
mode: val
transforms:
- type: LoadImages
- max_short: 512
type: LimitShort
- mult_int: 32
type: ResizeToIntMult
- type: Normalize
type: MattingDataset
val_file: val.txt
optimizer:
momentum: 0.9
type: sgd
weight_decay: 0.0005
lr_scheduler:
end_lr: 0
learning_rate: 0.01
power: 0.9
type: PolynomialDecay
warmup_iters: 1000
warmup_start_lr: 1.0e-05
model:
backbone:
pretrained: https://bj.bcebos.com/paddleseg/dygraph/PP_STDCNet1.tar.gz
type: STDC1
decoder_channels:
- 128
- 96
- 64
- 32
- 16
dpp_merge_type: add
dpp_output_channel: 256
head_channel: 8
type: PPMattingV2
------------------------------------------------
2023-05-01 20:09:41 [INFO] Set device: cpu
2023-05-01 20:09:41 [INFO] Use the following config to build model
model:
backbone:
pretrained: https://bj.bcebos.com/paddleseg/dygraph/PP_STDCNet1.tar.gz
type: STDC1
decoder_channels:
- 128
- 96
- 64
- 32
- 16
dpp_merge_type: add
dpp_output_channel: 256
head_channel: 8
type: PPMattingV2
2023-05-01 20:09:42 [INFO] Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/PP_STDCNet1.tar.gz
2023-05-01 20:09:42 [INFO] There are 145/145 variables loaded into STDCNet.
2023-05-01 20:09:43 [INFO] Number of predict images = 1
2023-05-01 20:09:43 [INFO] Loading pretrained model from pretrained_models/ppmattingv2-stdc1-human_512.pdparams
2023-05-01 20:09:43 [INFO] There are 485/485 variables loaded into PPMattingV2.
2023-05-01 20:09:43 [INFO] Start to predict...
Traceback (most recent call last):
File "tools/predict.py", line 114, in <module>
main(args)
File "tools/predict.py", line 101, in main
predict(
File "D:\paddleseg_python3.8.0\PaddleSeg\Matting\tools\..\ppmatting\core\predict.py", line 158, in predict
data = preprocess(img=im_path, transforms=transforms, trimap=trimap)
File "D:\paddleseg_python3.8.0\PaddleSeg\Matting\tools\..\ppmatting\core\predict.py", line 105, in preprocess
data['img'] = data['img'].unsqueeze(0)
File "D:\paddleseg_python3.8.0\WPy64-3.8.0.0\python-3.8.0.amd64\lib\site-packages\paddle\tensor\manipulation.py", line 2595, in unsqueeze
return _C_ops.unsqueeze(input, axes)
OSError: Invalid enum backend type `64`.
[C:\home\workspace\Paddle\paddle/phi/common/backend.h:140]