How to customize model structures, instead of using existing models? #1022
-
Our company needs to change specific hyperparameters in open_clip, like the number of layers in ResNet, length of image embeddings, vocabulary, etc. When I tried just simply modifying the RN50.json in model_configs folder, I found it not working. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@Leslie-Jiang-Hamster if copy any of the existing .json files and modify appropriate arguments and then use the name of that .json it will work fine. You should make sure that you are using the correct instance of the lib though, if you are using a pip installed module the changes won't be there, you need to do an editable install ( You can also call Any custom model config will obviously not have any pretrained CLIP model to load though but you can train it from scratch. |
Beta Was this translation helpful? Give feedback.
@Leslie-Jiang-Hamster if copy any of the existing .json files and modify appropriate arguments and then use the name of that .json it will work fine.
You should make sure that you are using the correct instance of the lib though, if you are using a pip installed module the changes won't be there, you need to do an editable install (
pip install -e
).You can also call
open_clip.add_model_config(path)
to add a config file at an arbitrary path into the current library and then call the create model...Any custom model config will obviously not have any pretrained CLIP model to load though but you can train it from scratch.