facebookresearch / maskrcnn-benchmark

Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.
MIT License
9.31k stars 2.49k forks source link

_C.SOLVER.TEST_PERIOD #1325

Open gzgz-code opened 3 years ago

gzgz-code commented 3 years ago

🐛 Bug

To Reproduce

I encountered this problem while running maskrcnn,defaults.py file have _C.SOLVER.TEST_PERIOD = 0 ,but when I debug this code , it can not read this attribute , does anyone have this problem?I would appreciate it if you could help me solve this problem.

train function: data_loader = make_data_loader( cfg, is_train=True, is_distributed=distributed, start_iter=arguments["iteration"], )

test_period = cfg.SOLVER.TEST_PERIOD
if test_period > 0:
    data_loader_val = make_data_loader(cfg, is_train=False, is_distributed=distributed, is_for_period=True)
else:
    data_loader_val = None

Expected behavior

Traceback (most recent call last): File "/home/hyh/Code/python/CL/CL_OBJECT_DETECTION/source/maskrcnn-benchmark/tools/train_net.py", line 202, in main() File "/home/hyh/Code/python/CL/CL_OBJECT_DETECTION/source/maskrcnn-benchmark/tools/train_net.py", line 195, in main model = train(cfg, args.local_rank, args.distributed) File "/home/hyh/Code/python/CL/CL_OBJECT_DETECTION/source/maskrcnn-benchmark/tools/train_net.py", line 76, in train test_period = cfg.SOLVER.TEST_PERIOD File "/home/hyh/anaconda3/envs/maskrcnn/lib/python3.8/site-packages/yacs/config.py", line 141, in getattr raise AttributeError(name) AttributeError: TEST_PERIOD

Environment

Please copy and paste the output from the environment collection script from PyTorch (or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

Additional context