PaddleHub icon indicating copy to clipboard operation
PaddleHub copied to clipboard

U2Net_Portrait 在paddlepaddle2.2.2和paddlehub2.2.0版本报错了 请帮忙看看~

Open duolabmeng6 opened this issue 3 years ago • 2 comments

欢迎您反馈PaddleHub使用问题,非常感谢您对PaddleHub的贡献! 在留下您的问题时,辛苦您同步提供如下信息:

  • 版本、环境信息 1)paddlepaddle2.2.2和paddlehub2.2.0 2)MacOS python3.7
import paddlehub as hub

model = hub.Module(name="U2Net_Portrait")
result = model.Portrait_GEN(paths=['./test.png'])
print(result)

[2022-04-22 19:56:48,132] [ WARNING] - The _initialize method in HubModule will soon be deprecated, you can use the __init__() to handle the initialization of the object
W0422 19:56:48.132697 189269504 analysis_predictor.cc:1350] Deprecated. Please use CreatePredictor instead.
Traceback (most recent call last):
  File "/Users/chensuilong/Desktop/pythonproject/paddleImageStyleTransfer/main2.py", line 4, in <module>
    result = model.Portrait_GEN(paths=['./test.png'])
  File "/Users/chensuilong/.paddlehub/modules/U2Net_Portrait/module.py", line 47, in Portrait_GEN
    processor = Processor(paths, images, batch_size, face_detection, scale)
  File "/Users/chensuilong/.paddlehub/modules/U2Net_Portrait/processor.py", line 14, in __init__
    self.input_datas = self.preprocess(self.imgs, batch_size, face_detection, scale)
  File "/Users/chensuilong/.paddlehub/modules/U2Net_Portrait/processor.py", line 91, in preprocess
    input_datas = np.concatenate(input_datas, 0)
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: need at least one array to concatenate

代码是参考这里的

https://github.com/PaddlePaddle/PaddleHub/tree/release/v2.2/modules/image/Image_gan/style_transfer/U2Net_Portrait

image

duolabmeng6 avatar May 10 '22 09:05 duolabmeng6

报错信息显示input data没有数据,建议从输入开始排查哪里有问题。

haoyuying avatar May 12 '22 09:05 haoyuying

报错信息显示input data没有数据,建议从输入开始排查哪里有问题。

你们能不能帮忙检查一下啊

duolabmeng6 avatar May 23 '22 04:05 duolabmeng6