module 'apex.amp' has no attribute 'initialize'?
See original GitHub issuehi,this is my code,but it get an error shows:
AttributeError: module ‘apex.amp’ has no attribute ‘initialize’
what is the problem?thanks~
from apex import amp
model = build_detection_model(cfg)
device = torch.device(cfg.MODEL.DEVICE)
model.to(device)
optimizer = make_optimizer(cfg, model)
scheduler = make_lr_scheduler(cfg, optimizer)
# Initialize mixed-precision training
use_mixed_precision = cfg.DTYPE == "float16"
amp_opt_level = 'O1' if use_mixed_precision else 'O0'
model, optimizer = amp.initialize(model, optimizer, opt_level=amp_opt_level)
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Using Apex AMP with PyTorch optimizers causes Attribute ...
Hi. I'm facing some issues when I'm trying to use PyTorch optimizers with Apex AMP. My environment is: OS: Ubuntu 18.04.5 Python: 3.8.5 ......
Read more >Source code for apex.amp.frontend
__dict__["options"] if name in options: return options[name] raise AttributeError("'{}' object has no attribute '{}'".format( type(self).
Read more >Python Examples of apex.amp.state_dict
__dict__: save_state['amp'] = amp.state_dict() if model_ema is not None: ... 'module') and not self.ema_has_module with torch.no_grad(): msd ...
Read more >module 'torch.cuda' has no attribtue 'amp' 问题解决
之前没有使用过apex,所以使用apex的时候,发现报了一条错误。 ... 经过不断的尝试,终于找到了问题的原因。原因在于torch.cuda.amp是在torch1 ...
Read more >module 'torch.distributed' has no attribute 'is_initialized' in ...
In order to solve this problem. Actually Window and Mac doesn't support distributed training facility. so this issue is occuring.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hi @ptrblck, i reinstall the apex from source and problem solved
any solution fro this issue? I have tried putting it in the current working directory and also added
--use
when installing it, but still have the error.