facebookresearch / facebookresearch/detectron2
checkpoint not loaded completely
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
## Instructions To Reproduce the 🐛 Bug:
1. Full runnable code or full changes you made:
I am training on custom dataset, training is going well i think but when i try to evaluate the model. I get issues loading the checkpoint. This is similar to https://github.com/facebookresearch/detectron2/issues/4090 but the issue has been closed without providing solution so I am opening this new one.
SO i first had issues with initialising the process and found that i needed more than a GPU to train. Using
```
dist.init_process_group(
backend="nccl", init_method="tcp://localhost:23456", rank=0, world_size=1
)
```
removed the error, but I am not sure if it is related to the checkpoint issues.
2. What exact command you run:
```
from train_model import Trainer
cfg = get_cfg()
cfg.merge_from_file(settings.paths.models_config)
cfg.merge_from_list(["MODEL.WEIGHTS", settings.paths.models_weights])
cfg.DATASETS.TRAIN = (f"{dataset_name}_{set}",)
cfg.DATASETS.TEST = ()
cfg.SOLVER.IMS_PER_BATCH = 2
# TODO should not be hardcoded (len of something)
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 15
cfg.OUTPUT_DIR = settings.paths.output_dir
cfg.MODEL.BASIS_MODULE.LOSS_ON = False
cfg.freeze()
rank = comm.get_rank()
setup_logger(cfg.OUTPUT_DIR, distributed_rank=rank, name="adet")
dist.init_process_group(
backend="nccl", init_method="tcp://localhost:23456", rank=0, world_size=1
)
trainer = Trainer(cfg)
trainer.resume_or_load()
train_results = trainer.train()
```
I have attached the Trainer class [train_net.txt](https://github.com/facebookresearch/detectron2/files/8426729/train_net.txt)
4. __Full logs__ or other relevant observations:
```
```
5. please simplify the steps as much as possible so they do not require additional resources to
run, such as a private dataset.
## Expected behavior:
If there are no obvious error in "full logs" provided above,
please tell us the expected behavior.
## Environment:
Provide your environment information using the following command:
```
---------------------- -------------------------------------------------------------------------------------
sys.platform linux
Python 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51) [GCC 9.4.0]
numpy 1.22.0
detectron2 0.6 @/opt/halodi/halodi-segmentation/halodi_segmentation/models/detectron2/detectron2
Compiler GCC 9.3
CUDA compiler CUDA 11.6
detectron2 arch flags 5.2, 6.0, 6.1, 7.0, 7.5, 8.0, 8.6
DETECTRON2_ENV_MODULE
PyTorch 1.11.0a0+bfe5ad2 @/opt/conda/lib/python3.8/site-packages/torch
PyTorch debug build False
GPU available Yes
GPU 0 NVIDIA GeForce RTX 3080 (arch=8.6)
Driver version 510.47.03
CUDA_HOME /usr/local/cuda
TORCH_CUDA_ARCH_LIST 5.2 6.0 6.1 7.0 7.5 8.0 8.6+PTX
Pillow 8.2.0
torchvision 0.12.0a0 @/opt/conda/lib/python3.8/site-packages/torchvision
torchvision arch flags 5.2, 6.0, 6.1, 7.0, 7.5, 8.0, 8.6
fvcore 0.1.5.post20220305
iopath 0.1.9
cv2 3.4.11
---------------------- -------------------------------------------------------------------------------------
PyTorch built with:
- GCC 9.3
- C++ Version: 201402
- Intel(R) Math Kernel Library Version 2019.0.5 Product Build 20190808 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v2.2.3 (Git Hash N/A)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: AVX2
- CUDA Runtime 11.6
- NVCC architecture flags: -gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_86,code=compute_86
- CuDNN 8.3.2 (built against CUDA 11.5)
- Magma 2.5.2
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.6, CUDNN_VERSION=8.3.2, CXX_COMPILER=/usr/bin/c++, CXX_FLAGS=-fno-gnu-unique -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.11.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=ON, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,
```
Contributor guide
Research direction
Read the attached train_net.txt and the shown training script, starting at Trainer.resume_or_load(), MODEL.WEIGHTS, and dist.init_process_group(). Reproduce the checkpoint-loading behavior with the reported configuration and logs; done means determining whether the missing basis_module parameters indicate a loading defect or an expected configuration mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100