可别手动编译paddlepaddle了!本蒟蒻才疏学浅,竟以为DLL load failed是64位系统的锅,没想到今天随便倒腾了一下给解决了。
我手动编译了一个星期,尝试了mingw,结果不支持bigobj,换VS,(本蒟蒻以前没有装它),600多个项目只成功了40多个,生成的setup.py也有问题,问题是:缺少mkldnn.dll。
让我不禁想到了DLL load failed,莫非它的问题就是在这里?
结果我把C:\Program Files\Python36\Lib\site-packages\paddle\libs\mkldnn.dll拷贝到C:\Program Files\Python36\Lib\site-packages\paddle\fluid目录下,就不再报dll load failed了!
其实这个DLL load failed指的不是core_avx.pyd,而是用于深度学习加速CPU的mkldnn.dll,真是…
可是第二个错来了,
Traceback (most recent call last):
File "D:\(马赛克qwq)", line 1, in <module>
import paddlehub as hub
File "C:\Program Files\Python36\lib\site-packages\paddlehub\__init__.py", line 25, in <module>
from . import module
File "C:\Program Files\Python36\lib\site-packages\paddlehub\module\__init__.py", line 16, in <module>
from . import module
File "C:\Program Files\Python36\lib\site-packages\paddlehub\module\module.py", line 31, in <module>
from paddlehub.common import utils
File "C:\Program Files\Python36\lib\site-packages\paddlehub\common\__init__.py", line 16, in <module>
from . import utils
File "C:\Program Files\Python36\lib\site-packages\paddlehub\common\utils.py", line 33, in <module>
from paddlehub.common.logger import logger
File "C:\Program Files\Python36\lib\site-packages\paddlehub\common\logger.py", line 156, in <module>
logger = Logger()
File "C:\Program Files\Python36\lib\site-packages\paddlehub\common\logger.py", line 68, in __init__
level = json.load(fp).get("log_level", "DEBUG")
File "C:\Program Files\Python36\lib\json\__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Program Files\Python36\lib\json\__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python36\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python36\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
肿么回事?打开C:\Users\Administrator.paddlehub\conf\config.json,里面竟然是空的!怎么办?喂点代码吃吃:
{"server_url": ["http://paddlepaddle.org.cn/paddlehub"], "resource_storage_server_url": "https://bj.bcebos.com/paddlehub-data/", "debug": false, "log_level": "DEBUG", "hub_name": "3c1171f799b87cc37db3f232159d2809-1587800357"}
完美解决!试了一下人脸识别:
import paddlehub as hub
module=hub.Module(name='pyramidbox_lite_mobile_mask')
image_list=['face.jpg']#图片名称
input_dict={'image':image_list}
module.face_detection(data=input_dict)
face.jpg识别后的结果:
希望对大家有所帮助!(本蒟蒻先溜了…