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 'test' #676

Open
Bradly-s opened this issue Jan 29, 2024 · 1 comment
Open

AttributeError: 'NoneType' object has no attribute 'test' #676

Bradly-s opened this issue Jan 29, 2024 · 1 comment
Assignees

Comments

@Bradly-s
Copy link

利用summary.py工具对videoswin模型进行计算参数量时报错:
Traceback (most recent call last):
File "tools/summary.py", line 113, in
main()
File "tools/summary.py", line 96, in main
params_info = paddle.summary(model, (1, 1, num_seg, 3, img_size, img_size))
File "/home/pl/anaconda3/envs/swfpd/lib/python3.7/site-packages/paddle/hapi/model_summary.py", line 308, in summary
result, params_info = summary_string(net, _input_size, dtypes, input)
File "/home/pl/anaconda3/envs/swfpd/lib/python3.7/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/home/pl/anaconda3/envs/swfpd/lib/python3.7/site-packages/paddle/base/dygraph/base.py", line 350, in _decorate_function
return func(*args, **kwargs)
File "/home/pl/anaconda3/envs/swfpd/lib/python3.7/site-packages/paddle/hapi/model_summary.py", line 444, in summary_string
model(*x)
File "/home/pl/anaconda3/envs/swfpd/lib/python3.7/site-packages/paddle/nn/layer/layers.py", line 1423, in call
return self.forward(*inputs, **kwargs)
File "/mnt/sdb1/swf/project/PaddleVideo/paddlevideo/modeling/framework/recognizers/base.py", line 55, in forward
return self.infer_step(data_batch)
File "/mnt/sdb1/swf/project/PaddleVideo/paddlevideo/modeling/framework/recognizers/recognizer_transformer.py", line 73, in infer_step
num_views = imgs.shape[2] // self.runtime_cfg.test.num_seg
AttributeError: 'NoneType' object has no attribute 'test'

@westfish
Copy link
Collaborator

westfish commented Feb 2, 2024

通常发生在配置文件(可能是模型的运行时配置)没有被正确加载或初始化,这里的关键是要确保runtime_cfg对象正确地包含了期望的test部分。

另外,如果有图像、视频理解和生成的需求,可以使用我们新的跨模态工具: https://github.com/PaddlePaddle/PaddleMIX/tree/develop

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

3 participants