Closed scott-vsi closed 2 years ago
It turns out, I also had to change the path computed by model_zoo/model_zoo.py:get_config_file before I could get the model to download. Even then, I still cannot run the demo using an fsdet:// path.
However, if I switch to the model_zoo branch and apply these changes then I can get the model and run the demo.
EDIT However, I cannot run training.
The path change in model_zoo/model_zoo.py:get_config_file (model_zoo.py is based on the same file in detectron2) is necessary because fsdet does not symlink the configs into the model_zoo directory on install like detectron2 does. (It doesn't have a setup.py script at all). Consequently, the path is correct in the case of detectron2.
https://github.com/facebookresearch/detectron2/blob/v0.3/setup.py#L141-L142
Just to close the loop, it appears that in fsdet v0.1, there was a setup.py file (like detectron2) that copied the configs directory into the model_zoo.
By using an older version of fvcore (along with this patch), I am now able to get a model, run the demo and run training on the master branch (6b0769b).
detectron2 v0.2.1 depends on fvcore>=0.1.1. However, fsdet expects fvcore:fvcore/common/checkpoint.py to import PathManager from fvcore.common.file_io, not iopath.common.file_io because fsdet registers a path handler (in fsdet/checkpoint/catalog.py:PathManager.register_handler) on fvcore.common.file_io.PathManager (as does the detectron2 package). However, this changed in 813a225. As such, we must use an fvcore release prior to 813a225 (there are no releases on github, but pypi has a ton. I used fvcore==0.1.2.post20201213)
EDIT Once the model_zoo branch gets merged in, the latest fvcore (0.1.3.post20210317) will work; however, the detectron2 dependency will need to be changed from 0.2.1 to >v0.4
Thanks for the detailed fix! I double checked the issue you mentioned and indeed you are right. Will merge your changes and make further fixes based on that.
As suggested in MODEL_ZOO.md, I tried running
However, that resulted in this error:
In 884c17f ("remove detectron2 dependencies") fsdet/config/config.py was removed and this was changed from
fsdet.config
todetectron2.config
. However, fsdet/config/config.py was then added back in 3cab324 ("more updates") and this file was never updated to match. fsdet/config/config.py imports fsdet/config/default.py, which defines MODEL.BACKBONE.FREEZE, which resolves this problem.