Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'load_config' from 'paddleslim.common' #1352

Closed
jo-dean opened this issue Aug 17, 2022 · 9 comments
Closed

Comments

@jo-dean
Copy link

jo-dean commented Aug 17, 2022

image

import 失败
安装了paddleslim 以及paddlepaddle 推理版本
image

@yghstill
Copy link
Collaborator

yghstill commented Aug 17, 2022

这个报错是由于没有安装最新版paddleslim,本周paddleslim会发布2.3.3版本,所以你暂时可以用两种方式的任何一种,即可import 最新版paddslim版本:

  1. 编译安装:
git clone https://github.com/PaddlePaddle/PaddleSlim.git & cd PaddleSlim
python setup.py install
  1. 直接在环境变量中指定python路径:export PYTHONPATH=/你的路径/PaddleSlim/:$PYTHONPATH

@jo-dean
Copy link
Author

jo-dean commented Aug 17, 2022

第一种方法可以了,但是进行自动压缩训练时出现了问题
AttributeError: 'numpy.ndarray' object has no attribute 'numpy'
image
这个update函数里的.numpy()都有问题。
我上周安装了就没有问题,可以直接训练,也没有出现:cannot import name 'load_config' from 'paddleslim.common'这个问题。

@yghstill
Copy link
Collaborator

@jo-dean 你是什么模型?.numpy()的这个问题在PaddleDetection已经修复过了,可以更新下develop的PaddleDetection试下

@jo-dean
Copy link
Author

jo-dean commented Aug 18, 2022

ppyolo_mbv3_samll
这是我的paddledet版本
image

image

@yghstill
Copy link
Collaborator

yghstill commented Aug 18, 2022

@jo-dean 你是voc数据集吗?或者你的ppyolo_mbv3_samll模型是不是不包含nms后处理?

@jo-dean
Copy link
Author

jo-dean commented Aug 19, 2022

自己的数据集,和VOC是一样格式的。
对的,没有nms

@jo-dean
Copy link
Author

jo-dean commented Aug 19, 2022

现在可以训练了,不过还是要在改了.numpy格式的情况下

@yghstill
Copy link
Collaborator

@jo-dean 嗯嗯,更新到PaddleDetection develop版本也可以,这个问题一个月前修复了,但ppdet还没发新版。

@jo-dean
Copy link
Author

jo-dean commented Aug 22, 2022

好的,谢谢

@jo-dean jo-dean closed this as completed Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants