通过 caffe 的 python 接口测试模型分类出现如下错误,TypeError: _open() got an unexpected keyword argument 'as_grey'
python classify-alexnet.py --gpu test.jpg result
...
I1005 15:32:11.174566 31243 net.cpp:244] This network produces output prob
I1005 15:32:11.174882 31243 net.cpp:257] Network initialization done.
I1005 15:32:11.199013 31243 upgrade_proto.cpp:79] Attempting to upgrade batch norm layers using deprecated params: /home/user/densenet121.caffemodel
I1005 15:32:11.199146 31243 upgrade_proto.cpp:82] Successfully upgraded batch norm layers using deprecated params.
I1005 15:32:11.199154 31243 net.cpp:746] Ignoring source layer label_data_1_split
I1005 15:32:11.205960 31243 net.cpp:746] Ignoring source layer fc6_fc6_0_split
I1005 15:32:11.205986 31243 net.cpp:746] Ignoring source layer loss
I1005 15:32:11.205992 31243 net.cpp:746] Ignoring source layer accuracy/top1
I1005 15:32:11.206010 31243 net.cpp:746] Ignoring source layer accuracy/top5
Loading file: test.jpg
Traceback (mos

在使用Caffe的Python接口进行模型测试时遇到TypeError,原因是scikit-image库0.17.2版本将'as_grey'参数改为'as_gray'。解决方案是更新Caffe的io.py文件,将'as_grey'替换为'as_gray'。
最低0.47元/天 解锁文章
3016

被折叠的 条评论
为什么被折叠?



