cvpods icon indicating copy to clipboard operation
cvpods copied to clipboard

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

Open JasonGITHUBH opened this issue 3 years ago • 15 comments

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 avatar Nov 29 '21 09:11 JasonGITHUBH

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.

JasonGITHUBH avatar Nov 29 '21 09:11 JasonGITHUBH

Did you run your pods_train command under network config dir?

FateScript avatar Nov 29 '21 13:11 FateScript

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 avatar Nov 29 '21 15:11 JasonGITHUBH

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

FateScript avatar Nov 30 '21 02:11 FateScript

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

JasonGITHUBH avatar Nov 30 '21 05:11 JasonGITHUBH

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

FateScript avatar Dec 01 '21 02:12 FateScript

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该了貌似也没用

xyq019971 avatar Jan 13 '22 08:01 xyq019971

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

FateScript avatar Jan 13 '22 09:01 FateScript

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 avatar Feb 24 '22 02:02 Tianhao-Qi

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)

Tianhao-Qi avatar Feb 24 '22 03:02 Tianhao-Qi

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 avatar Feb 24 '22 06:02 FateScript

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

FateScript avatar Feb 24 '22 06:02 FateScript

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 avatar Apr 28 '22 08:04 shenhaibb

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 avatar Apr 28 '22 08:04 shenhaibb

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 "../"

shenhaibb avatar Apr 28 '22 08:04 shenhaibb