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

AttributeError: 'NoneType' object has no attribute 'train' #1459

Closed
songnanx opened this issue Oct 22, 2021 · 5 comments
Closed

AttributeError: 'NoneType' object has no attribute 'train' #1459

songnanx opened this issue Oct 22, 2021 · 5 comments
Assignees

Comments

@songnanx
Copy link

songnanx commented Oct 22, 2021

对模型量化时报错
PaddleSlim 2.1.1
paddlepaddle-gpu 2.1.3.post112
paddleseg 2.3
image

@juncaipeng
Copy link
Collaborator

juncaipeng commented Oct 25, 2021

量化的文档中建议安装paddlepaddle-gpu的nightly build版本,近期会发布paddlepaddle-gpu 2.2版本,到时候也可以安装2.2版本。
https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.3/docs/slim/quant/quant.md#31-%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87

@juncaipeng juncaipeng self-assigned this Oct 25, 2021
@Darki-luo
Copy link

Darki-luo commented Dec 7, 2021

量化的文档中建议安装paddlepaddle-gpu的nightly build版本,近期会发布paddlepaddle-gpu 2.2版本,到时候也可以安装2.2版本。 https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.3/docs/slim/quant/quant.md#31-%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87

ubuntu18.04
PaddleSlim 2.1.1
PaddlePaddle-gpu=2.2.1
Paddleseg=2.3
python=3.8.12
cudatoolkit=10.2 cudnn=7.6.5

W1207 19:16:10.254144 10534 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.0, Runtime API Version: 10.2
W1207 19:16:10.254165 10534 device_context.cc:465] device: 0, cuDNN Version: 7.6.
2021-12-07 19:16:11 [INFO] Loading pretrained model from /home/w/python/laaneseg/output/bisenet/iter_5000/model.pdparams
2021-12-07 19:16:11 [INFO] There are 356/356 variables loaded into BiSeNetV2.
2021-12-07 19:16:11 [INFO] Loaded trained params of model successfully
2021-12-07 19:16:11 [INFO] Quantize all target ops
2021-12-07 19:16:12 [INFO] Quantize the model successfully
Traceback (most recent call last):
File "slim/quant/qat_train.py", line 212, in
main(args)
File "slim/quant/qat_train.py", line 193, in main
train(
File "/home/w/python/laaneseg/Pdseg/paddleseg/core/train.py", line 95, in train
model.train()
AttributeError: 'NoneType' object has no attribute 'train'
还是报这个错误

@wayneck
Copy link

wayneck commented Jan 13, 2022

更新了版本还是一样的错!能给个靠谱的方案吗?
......
2022-01-13 18:00:33 [INFO] Quantize the model successfully
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
File "slim/quant/qat_train.py", line 217, in
main(args)
File "slim/quant/qat_train.py", line 198, in main
train(
File "/xxx/PaddleSeg/paddleseg/core/train.py", line 95, in train
model.train()
AttributeError: 'NoneType' object has no attribute 'train'

@A834309
Copy link

A834309 commented Mar 5, 2022

同样的问题,求个解决方案~

@juncaipeng
Copy link
Collaborator

已经提供修复PR。

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

5 participants