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

Issue in loading pre-trained model #5163

Open
hapyty opened this issue Nov 27, 2023 · 3 comments
Open

Issue in loading pre-trained model #5163

hapyty opened this issue Nov 27, 2023 · 3 comments

Comments

@hapyty
Copy link

hapyty commented Nov 27, 2023

Hello! The pre-trained model I load was trained by "epoch", so detectron2 can't recognize it. Then I met following error:

ValueError: Unsupported type found in checkpoint! epoch: <class 'int'>

Anyone met this error?
Enviroment info:


sys.platform linux
Python 3.7.13 (default, Mar 29 2022, 02:18:16) [GCC 7.5.0]
numpy 1.21.5
detectron2 0.5 @/data/wrz/transfiner/detectron2
Compiler GCC 7.3
CUDA compiler CUDA 10.2
detectron2 arch flags 7.0
DETECTRON2_ENV_MODULE
PyTorch 1.7.1 @/home/asc005/anaconda3/envs/transfiner/lib/python3.7/site-packages/torch
PyTorch debug build False
GPU available Yes
GPU 0,1 Tesla V100-PCIE-32GB (arch=7.0)
Driver version 440.64.00
CUDA_HOME /usr/local/cuda-10.2
Pillow 9.0.1
torchvision 0.8.2 @/home/asc005/anaconda3/envs/transfiner/lib/python3.7/site-packages/torchvision
torchvision arch flags 3.5, 5.0, 6.0, 7.0, 7.5
fvcore 0.1.5.post20221221
iopath 0.1.9
cv2 4.4.0


PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 10.2
  • NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-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_37,code=compute_37
  • CuDNN 7.6.5
  • Magma 2.5.2
  • Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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-variable -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 -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,
@github-actions github-actions bot added the needs-more-info More info is needed to complete the issue label Nov 27, 2023
Copy link

You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template.
The following information is missing: "Instructions To Reproduce the Issue and Full Logs"; "Your Environment";

@github-actions github-actions bot removed the needs-more-info More info is needed to complete the issue label Nov 27, 2023
@Prayag22
Copy link

Looks like you have a problem loading pre-trained models firstly load the correct yaml file depending upon which pretrained model to use you cannot have mask_rcnn_R_50_FPN_3x.yaml and use different models weight both should be same you can either define like this or give direct path to pretrained weights using
cfg.MODEL.WEIGHTS = ("pretrained_model_path")

cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")) cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")

@FurkanGozukara
Copy link

Looks like you have a problem loading pre-trained models firstly load the correct yaml file depending upon which pretrained model to use you cannot have mask_rcnn_R_50_FPN_3x.yaml and use different models weight both should be same you can either define like this or give direct path to pretrained weights using cfg.MODEL.WEIGHTS = ("pretrained_model_path")

cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")) cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")

thank you for reply

can you also checkout this? #5170

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

3 participants