Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

cannot import name 'warmup_batchnorm' from 'utils' #4

Open
antlion0x opened this issue Apr 8, 2021 · 3 comments
Open

cannot import name 'warmup_batchnorm' from 'utils' #4

antlion0x opened this issue Apr 8, 2021 · 3 comments

Comments

@antlion0x
Copy link

Hi, thank you for your great work.
I am trying to train a model with main.py, but I got this error message:

Traceback (most recent call last):
  File "main.py", line 29, in <module>
    from utils import (
ImportError: cannot import name 'warmup_batchnorm' from 'utils' (/home/tyama/work/code/sample/selavi/utils.py)
Traceback (most recent call last):
  File "/home/tyama/miniforge3/envs/lab_vid/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/tyama/miniforge3/envs/lab_vid/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/tyama/miniforge3/envs/lab_vid/lib/python3.7/site-packages/torch/distributed/launch.py", line 253, in <module>
    main()
  File "/home/tyama/miniforge3/envs/lab_vid/lib/python3.7/site-packages/torch/distributed/launch.py", line 249, in main
    cmd=cmd)
subprocess.CalledProcessError: Command '['/home/tyama/miniforge3/envs/lab_vid/bin/python', '-u', 'main.py', '--local_rank=0', '--root_dir', '/home/tyama/work/code/sample/data/kinetics600', '--epochs', '200', '--batch_size', '16', '--base_lr', '1e-2', '--ds_name', 'kinetics', '--use_mlp', 'True', '--mlp_dim', '309', '--headcount', '10', '--match', 'True', '--distribution', 'gauss', '--ind_groups', '2']' returned non-zero exit status 1.

I have checked the definition of 'warmup_batchnorm' in utils.py, but I could not find its definition. Could you share the code of 'warmup_batchnorm'? Thank you!

@Seleucia
Copy link

I'm getting the same problem as well.

@mandelapatrick
Copy link
Contributor

Yes pushed this function in commit (33d2b2d). Let me know if this now works!

@Seleucia
Copy link

Seleucia commented May 6, 2021

Hello there is still bug in the function. We are getting error:
File "selavi/utils.py", line 412, in warmup_batchnorm
if args.distributed and args.world_size > 1:
AttributeError: 'Namespace' object has no attribute 'distributed'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants