While trying to load the pretrained R(2+1)D-152 models fine-tuned on Kinetics, I kept running into a KeyError in the model_urls variable in VMZ/pt/vmz/models/utils.py, and upon further inspection, the __init__ constructor in the R(2+1)D module (at VMZ/pt/vmz/models/r2plus1d.py) seems to be passing in malformed keys.
I noticed that a similar issue has been brought up in #105 and #74 (both closed by author), so I wanted to discuss if this is worth making a PR (it's very minor line edits)/how we might integrate these changes.
To fix this, I made the following changes to VMZ/pt/vmz/models/r2plus1d.py:
Change the string literal in declaring the arch variable (passed as a dictionary lookup to model_urls) from arch = "r2plus1d_" + pretraining to "r2plus1d34" + pretraining`
Change the default error behavior for setting arch (if passed-in key is not a pre-trained model) in R(2+1)D-152 from "r2plus1d_34" to `"r2plusid_152"
Add import model_urls from .utils to import statement
After running pip install -e . from the appropriate directory and hopping into the interpreter, I was able to download the pretrained model, as expected.
If this looks reasonable, I'm happy to open a PR following the instructions in CONTRIBUTING.md. I can take a look at other models in the zoo and run more rigorous testing as well.
Hello all,
While trying to load the pretrained R(2+1)D-152 models fine-tuned on Kinetics, I kept running into a
KeyError
in themodel_urls
variable inVMZ/pt/vmz/models/utils.py
, and upon further inspection, the__init__
constructor in the R(2+1)D module (atVMZ/pt/vmz/models/r2plus1d.py
) seems to be passing in malformed keys.I noticed that a similar issue has been brought up in #105 and #74 (both closed by author), so I wanted to discuss if this is worth making a PR (it's very minor line edits)/how we might integrate these changes.
To fix this, I made the following changes to
VMZ/pt/vmz/models/r2plus1d.py
:arch
variable (passed as a dictionary lookup tomodel_urls
) fromarch = "r2plus1d_" + pretraining
to "r2plus1d34" + pretraining`arch
(if passed-in key is not a pre-trained model) in R(2+1)D-152 from"r2plus1d_34"
to`"r2plusid_152"
model_urls
from.utils
to import statementAfter running
pip install -e .
from the appropriate directory and hopping into the interpreter, I was able to download the pretrained model, as expected.If this looks reasonable, I'm happy to open a PR following the instructions in
CONTRIBUTING.md
. I can take a look at other models in the zoo and run more rigorous testing as well.Thank you!