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

in experiment dir using pods_train --num-gpus 1, there is an error No module named 'config' [Usage] #77

Open
JasonGITHUBH opened this issue Nov 29, 2021 · 15 comments
Assignees

Comments

@JasonGITHUBH
Copy link

JasonGITHUBH commented Nov 29, 2021

Please use this template to submit your problem or your question will NOT be properly tackled.


Describe what you want to do, including:

  1. what inputs you will provide, if any:pods_train --num-gpus 1
  2. what outputs you are expecting:ModuleNotFoundError: No module named 'config'

❓ What does an API do and how to use it?

~/cvpods/playground/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x$ ls
config.py net.py README.md
~/cvpods/playground/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x$ pods_train --num-gpus 1
Traceback (most recent call last):
File "cvpods/tools/train_net.py", line 151, in
from config import config
ModuleNotFoundError: No module named 'config'

Pur your question here.
when I cd fcos.res50.fpn.coco.800size.1and use pods_train --num-gpus 1, there is an error No module named 'config' [Usage]

@JasonGITHUBH
Copy link
Author

I see there is simliar question in https://giters.com/Megvii-BaseDetection/cvpods/issues/15 but I tried pods_train --num-gpus 1, it failed again.

@FateScript
Copy link
Member

Did you run your pods_train command under network config dir?

@JasonGITHUBH
Copy link
Author

yes, I had Entered a specific experiment dir: ~/cvpods/playground/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x then use $ pods_train --num-gpus 1

@JasonGITHUBH JasonGITHUBH changed the title in experiment dir using pods_train --num-gpus 1, there is a error No module named 'config' [Usage] in experiment dir using pods_train --num-gpus 1, there is an error No module named 'config' [Usage] Nov 29, 2021
@JasonGITHUBH JasonGITHUBH changed the title in experiment dir using pods_train --num-gpus 1, there is an error No module named 'config' [Usage] in experiment dir using pods_train --num-gpus 1, there is an error No module named 'config' [Usage] Nov 29, 2021
@FateScript
Copy link
Member

Could you plz tell me your commit id, I will try to reimplemented your error.

@JasonGITHUBH
Copy link
Author

JasonGITHUBH commented Nov 30, 2021

Could you plz tell me your commit id, I will try to reimplemented your error.

I didn't change anything after installing cvpods.
Thank u, it can run now by adding

import sys
sys.path.append("~/cvpods/playground/detection/coco/fcos/fcos.res50.fpn.coco.800size.1x")

to cvpods/tools/train_net.py

@FateScript
Copy link
Member

That's wired, code here add sys path to import config.

@xyq019971
Copy link

i use former vision cvpods (cvpods-dump_voc_to_disk.zip)and there is no errors.
i use the newest vision cvpods and there is a same bug which is like upstairs, there is an error No module named 'config'.
the other bug is that config is fixed now matter how i modify it.
我用上一个版本的cvpods (cvpods-dump_voc_to_disk.zip)没有任何问题
我用新版本的cvpods就和楼上问题一样,找不到config。
我把config复制到tools里面虽然可以运行,但是无论我如何修改config的内容,他都只会运行base里面的内容,base该了貌似也没用

@FateScript
Copy link
Member

try to use python3 cvpods.tools.train_net --num-gpus 1?

@Tianhao-Qi
Copy link

i use former vision cvpods (cvpods-dump_voc_to_disk.zip)and there is no errors. i use the newest vision cvpods and there is a same bug which is like upstairs, there is an error No module named 'config'. the other bug is that config is fixed now matter how i modify it. 我用上一个版本的cvpods (cvpods-dump_voc_to_disk.zip)没有任何问题 我用新版本的cvpods就和楼上问题一样,找不到config。 我把config复制到tools里面虽然可以运行,但是无论我如何修改config的内容,他都只会运行base里面的内容,base该了貌似也没用

I meet the same problem and can't solve by using python3 cvpods.tools.train_net --num-gpus 1.

@Tianhao-Qi
Copy link

That's wired, code here add sys path to import config.

The code should be:

extra_sys_path = os.getcwd() if args.dir is None else args.dir
sys.path.append(extra_sys_path)

@FateScript
Copy link
Member

I meet the same problem and can't solve by using python3 cvpods.tools.train_net --num-gpus 1.

python3 -m cvpods.tools.train_net --num-gpus 1, -m missing in your your command.

@FateScript
Copy link
Member

Could solve this issue when your enter config dir and rerun again @Tianhao-Qi

@shenhaibb
Copy link

shenhaibb commented Apr 28, 2022

Could solve this issue when your enter config dir and rerun again @Tianhao-Qi

Permission denied: '/data'
I remove log and cmd again, this problem still is

2022-04-28 16:24:01.988 | INFO | main::155 - Create soft link to /data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x
2022-04-28 16:24:01.999 | ERROR | cvpods.engine.launch:launch:64 - An error has been caught in function 'launch', process 'MainProcess' (269199), thread 'MainThread' (140563564597632):
Traceback (most recent call last):

File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
│ │ └ {'name': 'main', 'doc': '\nDetection Training Script.\n\nThis scripts reads a given config file and runs the trai...
│ └ <code object at 0x7fd65a72cc90, file "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 6>
└ <function _run_code at 0x7fd780aec550>
File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
│ └ {'name': 'main', 'doc': '\nDetection Training Script.\n\nThis scripts reads a given config file and runs the trai...
└ <code object at 0x7fd65a72cc90, file "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 6>

File "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 157, in
launch(
└ <function launch at 0x7fd63100d160>

File "/media/henu/新加卷1/rxh/cvpods/cvpods/engine/launch.py", line 64, in launch
main_func(*args)
│ └ (Namespace(clearml=False, dir=None, dist_url='tcp://127.0.0.1:50152', eval_only=False, machine_rank=0, num_gpus=1, num_machin...
└ <function main at 0x7fd630facca0>

File "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 82, in main
cfg = default_setup(config, args)
│ │ └ Namespace(clearml=False, dir=None, dist_url='tcp://127.0.0.1:50152', eval_only=False, machine_rank=0, num_gpus=1, num_machine...
│ └ ╒═════════════════╤══════════════════════════════════════════════════════════════════════════════════════════════════════════...
└ <function default_setup at 0x7fd630facb80>

File "/media/henu/新加卷1/rxh/cvpods/cvpods/engine/setup.py", line 131, in default_setup
ensure_dir(output_dir)
│ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x'
└ <function ensure_dir at 0x7fd774c000d0>

File "/media/henu/新加卷1/rxh/cvpods/cvpods/utils/file/file_io.py", line 22, in ensure_dir
megfile.smart_makedirs(path, exist_ok=True)
│ │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x'
│ └ <function smart_makedirs at 0x7fd7723d0940>
└ <module 'megfile' from '/home/henu/.local/lib/python3.8/site-packages/megfile/init.py'>

File "/home/henu/.local/lib/python3.8/site-packages/megfile/smart.py", line 443, in smart_makedirs
SmartPath(path).makedirs(exist_ok)
│ │ └ True
│ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x'
└ <class 'megfile.smart_path.SmartPath'>
File "/home/henu/.local/lib/python3.8/site-packages/megfile/pathlike.py", line 245, in makedirs
self.mkdir(exist_ok=exist_ok)
│ │ └ True
│ └ <function _bind_function..smart_method at 0x7fd774932b80>
└ SmartPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x')
File "/home/henu/.local/lib/python3.8/site-packages/megfile/smart_path.py", line 14, in smart_method
return getattr(self.pathlike, name)(*args, **kwargs)
│ │ │ │ └ {'exist_ok': True}
│ │ │ └ ()
│ │ └ 'makedirs'
│ └ FSPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x')
└ SmartPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x')
File "/home/henu/.local/lib/python3.8/site-packages/megfile/pathlike.py", line 245, in makedirs
self.mkdir(exist_ok=exist_ok)
│ │ └ True
│ └ <function fs_makedirs at 0x7fd7748bb040>
└ FSPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x')
File "/home/henu/.local/lib/python3.8/site-packages/megfile/fs_path.py", line 18, in fs_method
return getattr(fs, name)(self.path_without_protocol, *args, **kwargs)
│ │ │ │ │ └ {'exist_ok': True}
│ │ │ │ └ ()
│ │ │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x'
│ │ └ FSPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x')
│ └ 'fs_makedirs'
└ <module 'megfile.fs' from '/home/henu/.local/lib/python3.8/site-packages/megfile/fs.py'>
File "/home/henu/.local/lib/python3.8/site-packages/megfile/fs.py", line 230, in fs_makedirs
return os.makedirs(path, exist_ok=exist_ok)
│ │ │ └ True
│ │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x'
│ └ <function makedirs at 0x7fd780bc8280>
└ <module 'os' from '/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py'>
File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
│ │ └ True
│ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor'
└ <function makedirs at 0x7fd780bc8280>
File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
│ │ └ True
│ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco'
└ <function makedirs at 0x7fd780bc8280>
File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
│ │ └ True
│ └ '/data/Outputs/model_logs/cvpods_playground/detection'
└ <function makedirs at 0x7fd780bc8280>
[Previous line repeated 4 more times]
File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
│ │ └ 511
│ └ '/data'

PermissionError: [Errno 13] Permission denied: '/data'

@shenhaibb
Copy link

Could solve this issue when your enter config dir and rerun again @Tianhao-Qi

Permission denied: '/data' I remove log and cmd again, this problem still is

2022-04-28 16:24:01.988 | INFO | main::155 - Create soft link to /data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x 2022-04-28 16:24:01.999 | ERROR | cvpods.engine.launch:launch:64 - An error has been caught in function 'launch', process 'MainProcess' (269199), thread 'MainThread' (140563564597632): Traceback (most recent call last):

File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, │ │ └ {'name': 'main', 'doc': '\nDetection Training Script.\n\nThis scripts reads a given config file and runs the trai... │ └ <code object at 0x7fd65a72cc90, file "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 6> └ <function _run_code at 0x7fd780aec550> File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) │ └ {'name': 'main', 'doc': '\nDetection Training Script.\n\nThis scripts reads a given config file and runs the trai... └ <code object at 0x7fd65a72cc90, file "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 6>

File "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 157, in launch( └ <function launch at 0x7fd63100d160>

File "/media/henu/新加卷1/rxh/cvpods/cvpods/engine/launch.py", line 64, in launch
main_func(*args)
│ └ (Namespace(clearml=False, dir=None, dist_url='tcp://127.0.0.1:50152', eval_only=False, machine_rank=0, num_gpus=1, num_machin...
└ <function main at 0x7fd630facca0>

File "/media/henu/新加卷1/rxh/cvpods/tools/train_net.py", line 82, in main cfg = default_setup(config, args) │ │ └ Namespace(clearml=False, dir=None, dist_url='tcp://127.0.0.1:50152', eval_only=False, machine_rank=0, num_gpus=1, num_machine... │ └ ╒═════════════════╤══════════════════════════════════════════════════════════════════════════════════════════════════════════... └ <function default_setup at 0x7fd630facb80>

File "/media/henu/新加卷1/rxh/cvpods/cvpods/engine/setup.py", line 131, in default_setup ensure_dir(output_dir) │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x' └ <function ensure_dir at 0x7fd774c000d0>

File "/media/henu/新加卷1/rxh/cvpods/cvpods/utils/file/file_io.py", line 22, in ensure_dir megfile.smart_makedirs(path, exist_ok=True) │ │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x' │ └ <function smart_makedirs at 0x7fd7723d0940> └ <module 'megfile' from '/home/henu/.local/lib/python3.8/site-packages/megfile/init.py'>

File "/home/henu/.local/lib/python3.8/site-packages/megfile/smart.py", line 443, in smart_makedirs SmartPath(path).makedirs(exist_ok) │ │ └ True │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x' └ <class 'megfile.smart_path.SmartPath'> File "/home/henu/.local/lib/python3.8/site-packages/megfile/pathlike.py", line 245, in makedirs self.mkdir(exist_ok=exist_ok) │ │ └ True │ └ <function _bind_function..smart_method at 0x7fd774932b80> └ SmartPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x') File "/home/henu/.local/lib/python3.8/site-packages/megfile/smart_path.py", line 14, in smart_method return getattr(self.pathlike, name)(*args, **kwargs) │ │ │ │ └ {'exist_ok': True} │ │ │ └ () │ │ └ 'makedirs' │ └ FSPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x') └ SmartPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x') File "/home/henu/.local/lib/python3.8/site-packages/megfile/pathlike.py", line 245, in makedirs self.mkdir(exist_ok=exist_ok) │ │ └ True │ └ <function fs_makedirs at 0x7fd7748bb040> └ FSPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x') File "/home/henu/.local/lib/python3.8/site-packages/megfile/fs_path.py", line 18, in fs_method return getattr(fs, name)(self.path_without_protocol, *args, **kwargs) │ │ │ │ │ └ {'exist_ok': True} │ │ │ │ └ () │ │ │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x' │ │ └ FSPath('/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x') │ └ 'fs_makedirs' └ <module 'megfile.fs' from '/home/henu/.local/lib/python3.8/site-packages/megfile/fs.py'> File "/home/henu/.local/lib/python3.8/site-packages/megfile/fs.py", line 230, in fs_makedirs return os.makedirs(path, exist_ok=exist_ok) │ │ │ └ True │ │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor/free_anchor.res50.fpn.coco.800size.1x' │ └ <function makedirs at 0x7fd780bc8280> └ <module 'os' from '/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py'> File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 213, in makedirs makedirs(head, exist_ok=exist_ok) │ │ └ True │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco/free_anchor' └ <function makedirs at 0x7fd780bc8280> File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 213, in makedirs makedirs(head, exist_ok=exist_ok) │ │ └ True │ └ '/data/Outputs/model_logs/cvpods_playground/detection/coco' └ <function makedirs at 0x7fd780bc8280> File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 213, in makedirs makedirs(head, exist_ok=exist_ok) │ │ └ True │ └ '/data/Outputs/model_logs/cvpods_playground/detection' └ <function makedirs at 0x7fd780bc8280> [Previous line repeated 4 more times] File "/home/henu/anaconda3/envs/cvpods/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) │ │ └ 511 │ └ '/data' └

PermissionError: [Errno 13] Permission denied: '/data'

soved, i changed the OUTPUT_DIR in my config.py

@shenhaibb
Copy link

That's wired, code here add sys path to import config.

maybe the dir is wrong. In my linux, i must input the whole dir not "../"

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

6 participants