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: 'augment_inputs_network' object has no attribute 'module'. Did you mean: 'modules'? #13

Open
hepburnalex opened this issue Sep 6, 2024 · 1 comment

Comments

@hepburnalex
Copy link

训练的时候报了这样的一个错误:“ File "/DeepFakeDefenders/main_train_single_gpu.py", line 130, in
train_engine.save_checkpoint(log_root, epoch_idx, train_top1, val_top1, ema_start)
File "/DeepFakeDefenders/core/mengine.py", line 243, in save_checkpoint
ema_stact_dict = self.ema_model.module.module.state_dict()
File "/root/miniconda3/envs/deepfake/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1269, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'augment_inputs_network' object has no attribute 'module'. Did you mean: 'modules'?”
请问您遇到过吗?

@Fieldhunter
Copy link
Contributor

您好,这里有两个module,其中的一个module本来是用于多卡分布式模型的,在单卡的时候应该去掉一个module。这里并没有针对单卡训练做修改,后续会针对这里的问题进行修复。很抱歉对您在使用我们代码的过程中造成困扰,您可以去掉一个module再尝试一下。如有其他问题,欢迎随时提出issue。

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