Detectron: Model download for inferencing

Created on 6 Feb 2018  路  6Comments  路  Source: facebookresearch/Detectron

Is it possible to download models off-line and use it for inferencing? The example uses -wts attribute to automatically download the models.

Most helpful comment

In config/baselines, make the changes in the necessary yaml file as below.
Under TRAIN, change the WEIGHTS parameter to local path.

Hope it helps.

All 6 comments

you can use example like this:
python2 tools/infer_simple.py --cfg configs/e2e_mask_rcnn_R-101-FPN_2x.yaml --output-dir output/ --image-ext jpg --wts models/model_final.pkl

I am still getting error as below:

user@user-ThinkStation-P500:~/detectron$ python tools/infer_simple.py --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml --output-dir output/ --image-ext jpg --wts models/R-101_offline.pkl demo
Caffe2 build configuration:
BLAS : Eigen
BUILD_TYPE : Release
CXX_FLAGS : -std=c++11 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization
FORCE_FALLBACK_CUDA_MPI : 1
GIT_VERSION : v0.8.1-1022-g723488c-dirty
HAS_MKL_DNN :
HAS_MKL_SGEMM_PACK :
PERF_WITH_AVX : 1
PERF_WITH_AVX2 : 1
UNIQUE_LONG_TYPEMETA :
USE_ACCELERATE :
USE_ATEN : OFF
USE_CUDA : ON
USE_EIGEN_FOR_BLAS : 1
USE_GFLAGS : OFF
USE_GLOG : OFF
USE_GLOO :
USE_LITE_PROTO :
USE_MKL :
USE_MPI : ON
USE_NCCL : ON
USE_NNPACK : ON
USE_NVTX :
USE_OPENMP : OFF
[E init_intrinsics_check.cc:54] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E init_intrinsics_check.cc:54] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E init_intrinsics_check.cc:54] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Traceback (most recent call last):
File "tools/infer_simple.py", line 147, in
main(args)
File "tools/infer_simple.py", line 98, in main
assert_and_infer_cfg()
File "/home/user/detectron/lib/core/config.py", line 1018, in assert_and_infer_cfg
cache_cfg_urls()
File "/home/user/detectron/lib/core/config.py", line 1025, in cache_cfg_urls
__C.TRAIN.WEIGHTS = cache_url(__C.TRAIN.WEIGHTS, __C.DOWNLOAD_CACHE)
File "/home/user/detectron/lib/utils/io.py", line 60, in cache_url
assert_cache_file_is_ok(url, cache_file_path)
File "/home/user/detectron/lib/utils/io.py", line 84, in assert_cache_file_is_ok
'download.').format(url, file_path, cache_file_md5sum, ref_md5sum)
AssertionError: Target URL https://s3-us-west-2.amazonaws.com/detectron/ImageNetPretrained/MSRA/R-101.pkl appears to be downloaded to the local cache file /tmp/detectron-download-cache/ImageNetPretrained/MSRA/R-101.pkl, but the md5 hash of the local file does not match the reference (actual: d202e9293a176402961b16df30e5748f vs. expected: c262408fcc4c119b9b6a177dd08b114f). You may wish to delete the cached file and try again to trigger automatic download.

Although no url is specified, it gives the assertion error with md5 hash mismatch

change the "WEIGHTS: https://s3-us-west-2.amazonaws.com/detectron/ImageNetPretrained/MSRA/R-101.pkl" in e2e_mask_rcnn_R-101-FPN_2x.yaml to your model path

Thanks a lot @uefall for your quick responses :)

@bhalajin How do you solve it, please?

In config/baselines, make the changes in the necessary yaml file as below.
Under TRAIN, change the WEIGHTS parameter to local path.

Hope it helps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kampelmuehler picture kampelmuehler  路  4Comments

twmht picture twmht  路  3Comments

kampelmuehler picture kampelmuehler  路  4Comments

junxiaoge picture junxiaoge  路  3Comments

baristahell picture baristahell  路  3Comments